How to add 2 callback to the Jshelper in Cakephp 2.x

纵饮孤独 提交于 2019-12-11 06:54:37

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!