问题
I want to add 2 callback to Js->submit, My first return true or false. Continuing with that I want to put action. I mean If it is true then it continue to action else halt at that moment.
What I have tried yet but its not taking 2 callback. Plaese help.
echo $this->Js->submit("Apply",
array(
'id' => 'submitForm', 'div' => false, 'class' => 'general_button', 'style' => array('float:none;', 'margin: 10px;'),
'url' => array(
'controller' => 'categories', 'action' => 'index', 'field' => $search_term, 'value' => $search_value, 'parentId' => $parentId
),
'update' => '#listID',
'confirm' => 'Are you sure you want to apply action to selected records ??',
'before' => $this->Js->event('click', 'return checkboxCount();', false),
'before' => $this->Js->get('#loaderID')->effect('fadeIn', array('buffer' => false)),
'complete' => $this->Js->get('#loaderID')->effect('fadeOut', array('buffer' => false)),
)
);
How will I continue with it. As function return checkboxCount();
returns true or false. but in here case my function is not even called.
来源:https://stackoverflow.com/questions/16167424/how-to-add-2-callback-to-the-jshelper-in-cakephp-2-x