Saurabh Gupta

Saurabh Gupta

  • 1.8k
  • 62
  • 678

Hello I Want To Bind Jqgrid Using Webmethod.

Jan 30 2015 12:36 AM
Here is my javascript
 
$(document).ready(function () {
var pageIndex = 1;
var pageCount;
var minCarat = $("#carat-min").val();
var maxCarat = $("#carat-max").val();
debugger;
$("#gvJQGrid").jqGrid({
// url: 'http://192.168.108.33/Diamond/default.aspx?jqGridID=JQGrid1',
url: 'SampleDefault.aspx/GetCustomers',
data: JSON.stringify({ 'pageIndex': pageIndex, 'mincart': minCarat, 'maxcart': maxCarat }),
contentType: "application/json; charset=utf-8",
mtype: "GET",
datatype: "json",
page: 1,
colNames: ['Shape', 'Carat', 'Cut', 'Color', 'Clarity', 'Polish', 'Symmetry', 'Depth', 'Table', 'Floroscence',
'Price_Ct', 'Culet', 'Details'],
colModel: [
{ name: 'Shape', align: 'center' },
{ name: 'Carat', align: 'center'},
{ name: 'Cut1', align: 'center' },
{ name: 'Color1', align: 'center' },
{ name: 'Clarity', align: 'center' },
{ name: 'Polish1', align: 'center' },
{ name: 'Symmetry1', align: 'center' },
{ name: 'Depth1', align: 'center' },
{ name: 'Table_1', align: 'center' },
{ name: 'Floroscence1', align: 'center' },
{ name: 'Price_Ct1', align: 'center' },
{ name: 'Culet1', align: 'center' },
{
name: 'View',
align: 'center',
formatter: formatButton
}
],
width: 840,
height: 500,
rowNum: 20,
scroll: 1, // set the scroll property to 1 to enable paging with scrollbar - virtual loading of records
emptyrecords: 'Scroll to bottom to retrieve new page', // the message will be displayed at the bottom
pager: "#jqGridPager"
});
});