During Document.Ready the grid’s columns property is an array. However, when called during page “run-time” it is not but is instead a property of columns named records… This leads to some interesting issues when calling a common function from both. So to fix, I added in a little shim function to get it as array no matter what – it is below for anyone whose having issues with this. Don’t know if its a bug or intentional (fix?):
function getColumnsArray() {
var bIsArray = $.isArray($(“#jqxgrid”).jqxGrid(‘columns’));
if (bIsArray) {
return $(“#jqxgrid”).jqxGrid(“columns”);
} else{
return $(“#jqxgrid”).jqxGrid(“columns”).records;
}
}