Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    ListGrid.getField('length') returns the number of fields instead of 'length' fiel

    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:
    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];
        }
    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:

    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];
        }
    I am working with Smartclient v10.0d_2014-02-13/LGPL Deployment.

    Thanks and regards,
    Last edited by martintaal; 18 Mar 2014, 07:54. Reason: Formatting the code

    #2
    Thanks for the notification. We've made a change to address this issue - please try the next nightly build (March 19 or above) and let us know if you continue to have problems with this.

    Regards
    Isomorphic Software

    Comment


      #3
      The problem has been solved, thank you very much.

      Comment

      Working...
      X