hello dear All,
I want to save filter with title and some description. How can i get the latest filtered IDS (for saving) from Gridview after success(as to avoid completion conflicts).
$(’.filter-form form’).submit(function(){
$.fn.yiiGridView.update('violence-mentioned-grid', {
'success': function(data) {
$('#violence-mentioned-grid').removeClass('grid-view-loading')
jQuery.ajax({
'success': function(data) {
$('#FilterStatus').html(data);
},
'type': 'POST',
'data': $('#save-filters-form').serialize(),
'url': '".$this->createUrl('/violencementioned/saveFilters',array('IDs'=>$model->getSearchDataAsString()))."',
});
},
});
and in model
public function getSearchDataAsString()
{
$IDs=null;
foreach($this->search()->getData(true) as $data){ // true is refreshment of dataprovider
$IDs.=$data->id."#";
}
return $IDs;
}
But it always returns the total number of rows Rather then filter, ANY idea or suggestion? working for last two days Please!!!!