I have a CGridView. Using the option selectionChanged when I click on the row I load another CGridView. For the first time the function/selector $.fn.yiiGridView.getSelection(id) gives correct selected ID and I successfully load the second CGridView. But when I click the second row of the first CGridView function/selector $.fn.yiiGridView.getSelection(id) does not work and in a console/debug gives an error “Uncaught TypeError: Cannot read property ‘tableClass’ of undefined”. What could be the problem.
This the that code snippet:
'selectionChanged'=>"js:function(id){
$('#ports').empty();
var url = '".Yii::app()->urlManager->createUrl('site/showports', array('id'=>''))."'+ $.fn.yiiGridView.getSelection(id);
$('#ports').load(url);
}",
Today I will try to follow the article behind that link.
But the interesting thing in my situation is the error:
"Uncaught TypeError: Cannot read property 'tableClass' of undefined".
I understand that after second clicking (select->un-selecting) the row there should be no "selected id". But before loading the second CGridView without selecting any row in the first CGridView in a console/debug if I give a command like
"$.fn.yiiGridView.getSelection('device-grid');"
I get at list an empty result but not an error like above. After selecting any row in the first CGridView I get at least some "ID" and deselecting that row I get again an empty result but again not an error. Just after loading the second CGridView the command in the console/debug
"$.fn.yiiGridView.getSelection('device-grid');"
gives an error. In the same time if I give this command regarding the second CGridView like