I have the following code which builds an array of columns to apply flex to. I tried using both ColIndx as well as dataIndx with the same result.
var flexCols = new Array();
$.each(columns, function (i, col)
{
if (col.doFlex)
flexCols.push(i); // (col.dataIndx);
});
if (flexCols.length > 0)
{
_pqSearchGrid.flex({ colIndx: flexCols }); // ({dataIndx: flexCols})
}
What I am finding is that the paramQuery code eventually gets down to the following function and passes the array (colIndx or dataIndx) as both parameters to this function:
setColWdArr: function(initH, finalH) {
var ci = finalH,
rip, self = this,
offset = self.riOffset,
jump = self.jump,
CM = self.colModel,
column, cell, rd, data = self.data,
width, fr = self.freezeRows,
maxWidth = self.maxHt + "px",
wd, consider, iM = self.iMerge,
m, initV = self.initV,
child, child2, isBody = self.isBody(),
isSum = self.isSum(),
takeColumnWidths = isBody || isSum,
finalV = self.isHead() ? self.that.headerCells.length - 1 : self.finalV;
if (finalV >= 0) {
for (; ci >= initH; ci--) {
column = CM[ci];
if (!column.hidden && (column.width + "").indexOf("%") == -1) {
wd = takeColumnWidths ? column.width : column._minWidth;
if (wd) {
The issue comes in at the line "column = CM[ci];". This is using an array as the indexer into the column model array. The result is column is undefined and the next statement generates the exception.
I verified that the data passed into the flex method was valid. In my case it was just an array with a single entry.