$("#list").jqGrid({
url: 'http://localhost:60418/grid/data',
datatype: 'json',
mtype: 'GET',
colNames: ['Inv No', 'Amount', 'Tax', 'Total', 'Notes'],
colModel :[
{name:'invid', index:'invid', width:55},
{name:'amount', index:'amount',width:80, align:'right'},
{name:'tax',index:'tax',width:80, align:'right'},
{name: 'total',index: 'total'},
{name: 'note',index: 'note'}
],
pager: '#pager',
rowNum: 10,
rowList: [10, 20, 30],
sortname: 'invid',
sortorder: 'desc',
viewrecords: true,
gridview: true,
caption: 'FirstGrid'
});
alert(
're');});
</script>@{
Layout =
null ;}
<!
DOCTYPE html ><
html ><
head > < title > Index </ title >< link href ="../../css/jquery-ui-1.9.2.custom/css/smoothness/jquery-ui-1.9.2.custom.css" rel ="stylesheet" />
@*
<link href="../../css/ui.jqgrid.css" rel="stylesheet" /> *@ < link href ="../../js/src/css/ui.jqgrid.css" rel ="stylesheet" /> < script src ="../../js/jquery-1.7.2.min.js"></ script > < script src ="../../js/i18n/grid.locale-en.js"></ script > < script src ="../../js/jquery.jqGrid.min.js"></ script >< script >
$(
function () {$(
"#list" ).jqGrid({url:
'http://localhost:60418/grid/data' ,datatype:
'json' ,mtype:
'GET' ,colNames: [
'Inv No' , 'Amount' , 'Tax' , 'Total' , 'Notes' ],colModel :[
{name:
'invid' , index: 'invid' , width:55},{name:
'amount' , index: 'amount' ,width:80, align: 'right' },{name:
'tax' ,index: 'tax' ,width:80, align: 'right' },{name:
'total' ,index: 'total' },{name:
'note' ,index: 'note' }],
pager:
'#pager' ,rowNum: 10,
rowList: [10, 20, 30],
sortname:
'invid' ,sortorder:
'desc' ,viewrecords:
true ,gridview:
true ,caption:
'FirstGrid'
});
alert(
're' );});
</ script >
</
head ><
body > < div > < table id ="list">< tr >< td /></ tr ></ table > < div id ="pager"></ div > </ div ></
body ></
html >