Tbbuttongroup Like Dropdownlist

on a view I have the following dropdown:




echo CHtml::dropDownList('program_id', Yii::app()->session['cur_program_id'], $arr2,

		array(

			'ajax' => array(

			        'type'=>'POST',

			        'url'=>CController::createUrl('salesStatement/UpdateAjax'),

			        'data'=>'js:jQuery(this).serialize()',

			        'success'=>'function(response) {

			                $("#outlet").html(response);

			                $.fn.yiiGridView.update("sales-statement-grid", {data: $(this).serialize()});

                     }',

			)

		)

	);



a newbie question, but could someone give me a headstart on how to make an ajax call from the TbButtonGroup widget, like in the dropdownlist that i quoted above?




    <?php $this->widget('bootstrap.widgets.TbButtonGroup', array(

        'type'=>'primary',

        'htmlOptions'=>array('id'=>'outlet_dropdown',),

        'buttons'=>array(

            array('label'=>'Select Outlet', 'items'=>$arr),

        ),

    )); ?>



how do i define the items array? Along these lines?




array_push($arr, array(

			'label'=>$value->description, 

			'url'=>array('salesStatement/UpdateAjax'),

			'buttonType'=>'ajaxLink',

			'ajaxOptions'=>array(

		        'type'=>'POST',

			),

		));



Thanks to @Lothor I have made some progress…

I have my TbNavBar:




<?php $this->widget('bootstrap.widgets.TbNavbar', array(

    'type'=>'', 

    'brand'=>'',

    'brandUrl'=>'#',

    'collapse'=>true,

	'fixed' => false,

    'items'=>array(

        array(

            'class'=>'bootstrap.widgets.TbMenu',

            'items'=>array(

                array('label'=>'select outlet', 

                	'url'=>'#', 

                	'active'=>false,

					'items'=>$arr,

					),

                array('label'=>'select year', 'url'=>'#'),

                array('label'=>'select month', 'url'=>'#'),

            ),

        ),

    ),

)); 

?>



where the items under the menu item "select outlet" are defined as:




	$arr = array();

	foreach($outlets as $value) {

		array_push($arr, array(

			'label'=>$value->description, 

			'url'=>'#',

			'linkOptions'=>array(

		        'ajax' => array(

		        	'type'=>'POST',

		        	'url'=>CController::createUrl('salesStatement/UpdateAjax'),

		        	'data'=>array('program_id'=>$value->program_id),

			        'success'=>'function(response) {

			        		oData = response.split("|");

			                $("#outlet").html(oData[0]);

							$("#stmnt_total").html(oData[1]+","+oData[2]+","+oData[3]+","+oData[4]+","+oData[5]);

			                $.fn.yiiGridView.update("sales-statement-grid", {data: $(this).serialize()});

                     }',

				)

			),

		));

	}



This all works fine, except for:

  1. when a link is clicked in the dropdown, the dropdown stays and does not close…

  2. labels with characters such as apostrophes get displayed as & # 0 3 9 ;

with a little bit of help from friends…