php - Yii TbButtonGroup wont work -
<?php $this->widget('bootstrap.widgets.tbbuttongroup', array( 'type'=>'success', 'buttons'=>array( array('label'=>'action', 'url'=>'#'), array('items'=>array( array( 'label'=>'set approved', 'url'=>$this->createurl('controller/dostuff'), 'buttontype'=>'ajaxbutton', 'ajaxoptions'=>array( 'beforesend' => 'function( request ) { alert(request); }' , 'success' => 'function( data ) { alert(data); }' , ), ), array('label'=>'set blocked', 'url'=>'#', 'buttontype' => 'ajaxlink'), array('label'=>'set pending', 'url'=>'#', 'buttontype' => 'ajaxlink'), )), ), )); ?>
i tried lot cannot working.. want use yiis ajax behaviour on first button of buttongroup.. dont javascript errors or anything.. if click link redirects me url - no ajax @ all. maybe have idea
i see in tbbutton file, see run()
method:
public function run() { echo $this->createbutton(); if ($this->hasdropdown()) { $this->controller->widget('bootstrap.widgets.tbdropdown', array( 'encodelabel'=>$this->encodelabel, 'items'=>$this->items, 'htmloptions'=>$this->dropdownoptions, )); } }
if button contained in items, instance of tbdropdown, not tbbutton; buttontype
, ajaxoption
tried provide useless.
you can choose solution replace solution. can set id each item , write javascript ajax manualy.
Comments
Post a Comment