ListGrid.getField returns a field definition based on a column number of field name. The problem is that if the field is name 'length' it does not return the field definition for the 'length' field, but the size of the fields array.
This is an excerp from the beginning of the getField function:
In our case this._noNumericFields is true. When this function is called with 'length' as the id parameter, this is executed:
field = this.fields['length'];
This is equivalent to this.fields.length, which is the length of the fields array. Being field not null, it is returned in the next line. This could be avoided if it is checked not only if field is not null, but also if field is an object:
I am working with Smartclient v10.0d_2014-02-13/LGPL Deployment.
Thanks and regards,
This is an excerp from the beginning of the getField function:
Code:
if (this._noNumericFields) { field = this.fields[id]; if (field != null) return field; } else { // Number: assume index. if (isc.isA.Number(id)) return this.fields[id]; }
field = this.fields['length'];
This is equivalent to this.fields.length, which is the length of the fields array. Being field not null, it is returned in the next line. This could be avoided if it is checked not only if field is not null, but also if field is an object:
Code:
if (this._noNumericFields) { field = this.fields[id]; if (field != null && isc.isAn.Object(field)) return field; } else { // Number: assume index. if (isc.isA.Number(id)) return this.fields[id]; }
Thanks and regards,
Comment