Pass Dataprovider Values To Javascipt

I want to use a Javascript Confirm box from a button in TbGridView however I am having problems passing the data into the javascript. The view is:

$this->widget('bootstrap.widgets.TbGridView', array(

    'type' => 'striped bordered condensed',

    'dataProvider' => $model->coninjob($cid, $job), 



    'summaryText'=>'Displaying {start}-{end} of {count} results.',

    'template' => "{summary}{items}{pager}",

    'columns' => array(

        array('name' => 'trading_name', 'header' => 'Trading Name'),

        array('name' => 'address', 'header'=> 'Address'),

        array('name' => 'abn', 'header' => 'ABN'),

        array('name' => 'newcontractor', 'header'=>'New', 'filter'=>false, 'value'=>'$data["newcontractor"]=="1"?"Yes":"No"'),







                        'onclick'=>'js:bootbox.confirm("Confirm Send Email to Contractor?",


                                if (confirmed) {








        'cledit' => array




           // 'url'=>'"index.php?r=ImportTask/email&id=$data->id&jobid=$data->task_id&contid=$data->provider_id&client=$data->client_id&new=$data->newcontractor"',

The specific problem is in the line

if (confirmed) {



$data->id does not render in the html as a value - How can I pass the $data variables to the javascript?

You might want to move that confirmation over to the cledit button where $data->id is available, e.g.:

'email' => array(



	'url'=>'Yii::app()->createUrl("svctix/emailinvoice", array("id"=>$data->id))',

        'htmlOptions'=>array('Your JavaScript here!'),


or else use an Ajax call and get $data->id as a JSON response.