I'd like to update this after running into the grid not auto resizing to full width after hiding the column. I found adding an inline if statement to the hidden field of the colModel
was able to solve both problems.
//before document ready
var fieldEnabled = true;
// in document ready
isFieldEnabled(); // some method to check, that will update `fieldEnabled`
grid.jqGrid({
//Other attributes
colModel:[
{name: 'ID', 'index': 'ID', hidden: fieldEnabled ? false : true }
// field enabled is just a boolean that is updated by whatever method you need to check if the column needs to show
]
loadComplete : function(){
//no need for changes here
First answer so I'm prepared to be crucified.