How to set Options in jqgrid?

Posted by Ankita on Stack Overflow See other posts from Stack Overflow or by Ankita
Published on 2010-04-23T04:42:59Z Indexed on 2010/04/23 4:43 UTC
Read the original article Hit count: 416

Filed under:

I need to set the Options for Jqgrid like toppager, forceFit for which the "Can be changed?" value is set to "No" hence i tired it to set by adding it this way

jQuery(document).ready(function() {

jQuery("#list").setGridParam({ forceFit: true, toppager: true }).trigger("reloadGrid");

jQuery("#list").jqGrid({

url: '<%= Url.Action("GridData") %>',

datatype: 'json',

mtype: 'GET',

colNames:['Time', 'Description', 'Category', 'Type', 'Originator', 'Vessel'],

colModel: [

{ name: 'Time', index: 'Time', width: 200, align: 'left' },

{ name: 'Description', index: 'Description', width: 600, align: 'left' },

{ name: 'Category', index: 'Category', width: 100, align: 'left' },

{ name: 'Type', index: 'Type', width: 100, align: 'left' },

{ name: 'Originator', index: 'Originator', width: 100, align: 'left' },

{ name: 'Vessel', index: 'Vessel', align: 'left'}],

pager: jQuery('#pager'),

rowNum: 20,

rowList: [10, 20, 50],

sortname: 'Time',

sortorder: "desc",

viewrecords: true,

hoverrows: false,

gridview: true,

emptyrecords: 'No data for the applied filter',

height: 460,

caption: 'Logbook Grid',

//forceFit: true,

width: 1200

}); });

But it didnt work Can u pls let me know what exactly i am doing wrong or the right way for this ?

© Stack Overflow or respective owner

Related posts about jqgrid