Ok, I think my approach is flawed or there’s something weird. I couldn’t even get the change() function to fire 
Plus, my two JS suggestions were not working because:
-
1st one: The input name begins with the model name so it’s NameOfYourModel[ParentID]. Thus my suggestion “Anyway, to be sure of the input’s name, you can use Firebug inspector” 
-
2nd one: The class is not applied to the thead rowns, but only to the tbody ones. Bad idea.
So here’s what I suggest, drop the change() function and:
[list=1]
[*]In your registered script, add this js function
// in Yii::app()->clientScript->registerScript('search', "
…
$('td.myLink a').live('click', function(){
$('input[name=\"NameOfYourModel[ParentID]\"]').val(10);
});
…
[*]Change your CGridView with the following:
<?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'), // it's not really needed either, just drop it
),
'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',
'htmlOptions'=>array('class'=>'myLink'),
),
'Description',
'CatOrder',
array(
'class'=>'CButtonColumn',
),
),
)); ?>
[/list]
On a side note, .live() is deprecated as of jQuery 1.7+ so, when the above works
you could try also with
$(document).on('click', 'td.myLink a', function(){
$('input[name=\"NameOfYourModel[ParentID]\"]').val(10);
});