THis is how I get the active tab from yiiTab.
Now I would like to pass the content of var datastr to my controller instead of simply 'display=mosaic" .
Anyone got an idea ?
echo CHtml::ajaxLink(
'/images/mosaic.png', 'mosaic',array('width'=>16)),'',
array(
'type'=>'GET',
'cache'=>false,
'url'=>$this->createUrl('/ads/index',array('display'=>'mosaic')),
'data'=>'display=mosaic',
'beforeSend'=>'function(){
// gets the active tab (starts at 1 )
var curtab=$(".yiiTab ul.tabs").find("a.active");
var href=curtab.attr("href");
var pos=href.substring(4); //get rid of "#tab" prefix
var datastr="display=mosaic&tab="+pos;
// alert(datastr);
}',
'success'=>'function(msg){
$("#clipall").replaceWith(msg);
}',
'error'=>'function(msg){alert("An error has happened");}'
)
);