Different Way To Pass parameters in Flexigrid

in This jQuery flexigrid tutorials help to pass parameters into flexigrid. jQuery flexigrid is very easy and attractive jquery grid plugin, which support many common features of grid like pagination,sorting and custom paging etc.

I will demonstrate about passing parameters into jquery flexigrid, parameters will be for shorting,searching and custom variables which will use in flexigrid data processing in server side.This tutorial will help to understand , Different way to pass parameters into flexigrid.

Also Checkout other tutorials of flexi grid,

Option 1: Parameters as a Query String

We can pass number of parameters as a query string into flexigrid using flexOptions() method.

Select Code
1
2
3
4
var status = jQuery('#task_status option:selected').text();
var phase = jQuery('#phase option:selected').val();
var keyword = jQuery('#keyword').val();
jQuery("#listing-grid").flexOptions({query: 'status='+status +'&phase='+phase +'&keyword='+keyword}).flexReload();

Option 2: Parameters as a JSON object

We can also pass parameters as a object into flexigrid using flexOptions() method.

Select Code
1
2
3
4
5
6
var postdata = {
'status': jQuery('#task_status option:selected').text(),
 'phase': jQuery('#phase option:selected').val(),
 'keyword':jQuery('#keyword').val()
};
jQuery("#listing-grid").flexOptions({query: jQuery.param(postdata)}).flexReload();

I hope it can help you to understand flexigrid with parameters.