bennouna, on 28 July 2012 - 10:08 AM, said:
Can you share an excerpt of your CGridView code, including the column you want to access and the CLinkColumn?
<?php $this->widget('zii.widgets.grid.CGridView', array(
'id'=>'eccategory-grid',
'dataProvider'=>$model->search(),
'filter'=>$model,
'columns'=>array(
'ID',
array(
'name'=>'ParentID',
'htmlOptions'=>array( 'id'=>'ParentID'),
),
'eccount',
array(
'name'=>'Published',
'value'=>'$data->Published==\'0\' ? "No":"Yes"',
'filter'=>CHtml::activedropDownList($model, 'Published',
array(
''=>'All',
'1'=>'Yes',
'0'=>'No',
)
),
),
array(
'class'=>'CLinkColumn',
'labelExpression'=>'$data->Name',
'urlExpression'=>'"javascript:change()"',
//'value'=>'CHtml::link(($data->ID), array("view", "id"=>$data->ID))',
),
'Description',
'CatOrder',
array(
'class'=>'CButtonColumn',
),
),
)); ?>
Thr ClinkColoumn is on the name but the filter I'm trying to access is called ParentID.
function change(){
//document.getElementById("ParentID").innerHTML="10";
$('input[name="ParentID"]').val(10);
// or, in case you added a class to the column
// $('some-grid table.items th.parent input').val(10);
}
</script>
The one you have given me line 2 has no response. The first line that's commented changes the actual value rather than inputting value on the filter. If I try .value instead of innerHTML I also get no response.
Thanks