I have a form with 3 text field and 2 combobox...I have send those data to server based on which my jqGrid will be populated...I can append the parameter like &text1=&text2& etc. Can someone point me towards an example based on binding form with jqGrid. Thanks!
UPdate1: my approach
<script type="text/javascript">
//<![CDATA[
jQuery(document).ready(function(){
var url = "/cpsb/inventoryInquiry.do?method=getInventoryDetails" + $("#inventoryForm").serialize();
navMenu();
jQuery("#inventoryInq").jqGrid({
sortable:true,
url: '',
datatype:'json',
colNames:['LPN','SKU', 'Location Description', 'Location Type','Pallet Status','On Hand Quantity', 'Inducted Quantity','Rejected Qty','Hold?','Expiration Date' ],
colModel:[ {name:'lpn',index:'lpn', width:85, sorttype:"int", align:"center", key:true},
{name:'sku',index:'sku', width:40, sorttype:"int", align:"center"},
{name:'locationDescription',index:'locationDescription', width:130, align:"center"},
{name:'locationType',index:'locationType', width:100, align:"center"},
{name:'palletStatus',index:'palletStatus', width:80, align:"center", sorttype:"int"},
{name:'onHandQuantity', index:'onHandQuantity',width:130, align:"center", sorttype:"int"},
{name:'inductedQuantity', index:'inductedQuantity', width:115, align:"center", sorttype:"int"},
{name:'rejectedQuantity', index:'rejectedQuantity', width:120, align:"center", sorttype:"int"},
{name:'hold',index:'hold', width:60,align:"center", sorttype:"int"},
{name:'expirationDate', index:'expirationDate',width:120, align:"center"} ],
rowNum:10,
rowList:[10,20,30],
jsonReader : {repeatitems: false,
root: function(obj) {
return obj;
},
page: function (obj) { return 1; },
total: function (obj) { return 1; },
records: function (obj) { return obj.length; }
},
pager: '#pager',
sortname: 'LPN',
sortorder: "desc",
loadonce:true,
viewrecords: true,
multiselect: true,
caption: "Inventory Inquiry",
height:230
});
jQuery("#inventoryInq").jqGrid('navGrid','#pager',{view:true,add:false,edit:false,del:false, searchtext:'Filter'},{},{},{},{multipleSearch:true});
jQuery("#inventoryInq").jqGrid('hideCol', 'cb');
}) ;
$("form#inventoryForm").submit(function() {
var newUrl = "/cpsb/inventoryInquiry.do?method=getInventoryDetails" + $(this).serialize();
$("#inventoryInq").jqGrid("setGridParam","url", url).trigger("reloadGrid");
return false;
});
//]]>
</script>