D
D
des1roer2015-08-27 10:59:29
JavaScript
des1roer, 2015-08-27 10:59:29

Yii CCheckBoxColumn call js function?

how to call js function on click on checkbox?

$myarray[] = array(
            'name' => 'active',
            'class' => 'CCheckBoxColumn',
            'checked' => '0',
            'value' => '$data->id',
            'header' => $c,
            //'checkBoxHtmlOptions' => array('onclick' => '$.get(\'/admin/page/active/id/\'+this.value+\'/e/\'+(this.checked?1:0),\'\',function(data){} );')
            'checkBoxHtmlOptions' => array('onclick' => 'write()'),
           /*'onchange' =>  'javascript:'
                    . 'if(this.checked)'
                    . ' document.getElementById("elem[$i][$c]").value= new Date().toLocaleDateString() +" "+ new Date().toLocaleTimeString(); '
                    . 'else document.getElementById("Engine_recovered").value="";'*/
        );

onchange says don't know. how to work with option? And how to determine whether it is pressed or not?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question