how to set width of column of jqGrid

Working on jqGrid, and want to change the width of columns? You are landed at a right place take a look at following discussion to get it done quickly. jqGrid is very easy to configure and it has lots of functions and variables to customize it as per our needs.

use this in jqGrid configuration code

var jqGridObj = $('#tableIdForGrid');

jqGridObj.jqGrid({  
...,
"colModel" : [
{
"name":"description",
"index":"description",
"align":"left",
"sorttype":"text",
"width" : 50, 
}
],
...,
});

Explanation
You can easily set the width of every column of jqGrid by the configuration variable width in colModel property of jqGrid. Above sample code is self explanatory.

0 comments:

Post a Comment

Ask queries, report bugs, send enhancements and tips that you have experienced.

SHARE