Its as simple as just passing data using the parameter serializeGridData in jqgrid
$(function () { var defaultsearchField = "id"; var defaultsearchString = "5"; var defaultsearchOper = "gt"; jQuery("#grid").jqGrid({ url:'GetDetails.asmx?team=All', datatype: "json", colNames:['ID','Name','Country','Progress'], colModel:[ {name:'id',index:'id', width:55}, {name:'Icon',index:'Icon', width:90}, {name:'name',index:'name asc, invdate', width:100}, {name:'designation',index:'designation', width:80}], rowNum:10, rowList:[10,20,30], pager: '#pager', sortname: 'id', viewrecords: true, sortorder: "desc", caption:"JSON Data", serializeGridData: function (postData) { if(defaultsearchField != null) { postData.searchField = defaultsearchField; postData.searchString = defaultsearchString; postData.searchOper = defaultsearchOper; } else { if (postData.searchField === undefined) postData.searchField = null; if (postData.searchString === undefined) postData.searchString = null; if (postData.searchOper === undefined) postData.searchOper = null; } return JSON.stringify(postData); }, }); });
Now the webservice will get the default search condition and should be able to work straight away. Unless if search is not handled on web service side.
Three things are certain:
Death, taxes, and lost data.
Guess which has occurred.
~David Dixon, 1998, winning entry of the Haiku Error Messages 21st Challenge by Charlie Varon and Jim Rosenau, sponsored by Salon.com
Great Article
ReplyDeleteASP.NET MVC Training
Online MVC Training
Online MVC Training India
Dot Net Training in Chennai
.Net Online Training
.net training online
Dot Net Online Training
C# Training