Hello:
The subject kind of says it all but I have a button with dropdowns. How would I go about getting the URL when a dropdown is clicked?
$this->beginWidget('bootstrap.widgets.TbBox', array(
'title'=>'Expense Reports',
'id'=>'events-box',
'headerIcon' => 'icon-list',
'htmlOptions' => array('class'=>'bootstrap-widget-table','id'=>'expense-box'),
'headerButtons'=>array(
array(
'class'=>'bootstrap.widgets.TbButton',
'type'=>'primary',
'label'=>'Create',
'icon'=>'icon-plus',
'htmlOptions'=>array(
'id'=>'create-button',
'data-toggle' => 'modal',
'data-target' => '#expenseModal'),
),
array(
'class'=>'bootstrap.widgets.TbButton',
'type'=>'warning',
'label'=>'Notify Instructors',
'icon'=>'icon-envelope',
'htmlOptions'=>array('id'=>'notify-instructors'),
'items' => array(
array('label' => 'Pay Period: '.$pay_periods[0], 'url'=>'#','href'=>$pay_periods[0]),
array('label' => 'Pay Period: '.$pay_periods[1], 'url' => $pay_periods[1]),
),
),
array(
'class'=>'bootstrap.widgets.TbButton',
'type'=>'success',
'label'=>'Approve',
'icon'=>'icon-thumbs-up',
'htmlOptions'=>array('id'=>'approve-expenses'),
),
)));
And in Javascript:
$('.dropdown-menu').click(function(event){
//Lets grab the URL and send it over...
event.preventDefault();
alert($(this).get('url')); //This does not work
alert($(this).prop('url')); //This does not work either
alert($(this).attr('url')); //Nope
}