Announcement

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

    ListGrid.showIf on rowNumberField breaks fields and filter

    SmartClient Version: v10.0p_2015-09-26/Enterprise Development Only (built 2015-09-26)

    Chrome on OSX

    Hello, please modify the #filter sample like this:

    Code:
    isc.ListGrid.create({
        ID: "countryList",
        width:500, height:300, alternateRecordStyles:true,
        dataSource: worldDS,
        fields:[
            {name:"countryCode", title:"Code", width:50},
            {name:"countryName", title:"Country"},
            {name:"capital", title:"Capital"},
            {name:"continent", title:"Continent"}
        ],
        autoFetchData: true,
        showFilterEditor: true,
        showRowNumbers: true,
        rowNumberFieldProperties: {
            canFilter: false,
            showIf: function (list, field, fieldNum) {
                var filterEditorCriteria = list.getFilterEditorCriteria(true);
                return !isc.isA.emptyObject(filterEditorCriteria);
            }
        }
    
    })
    You'll see that the filter and the fields renders as in the attachment


    Last edited by claudiobosticco; 29 Sep 2015, 06:29.

    #2
    Using "showIf" on the rowNumberField properties in conjunction with 'showRowNumbers:true' is likely to confuse things.
    Better to dynamically set showRowNumbers to true on dataChanged() [once a filter is complete - which could be determined by looking at lengthIsKnown() on the data object].
    If you change showRowNumbers at runtime, you'll want to call 'refreshFields()' to cause the actual fields to be recalculated.

    Comment


      #3
      Thanks for the suggestion, now it's working.

      Comment

      Working...
      X