Announcement

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

    Limit number of of records in ListGrid

    I have a ListGrid where a user can edit records. I have an add button that calls ListGrid.startEditing() to add a new record. I added an EditCompleteHandler that if ListGrid.getRecords().length is greater than the limit, then disable the add button so the user cannot add anymore records. This works fine until I added validation to the fields. Now when there's an error, ListGrid.getRecords() does not count that record so my limit is not being checked correctly--the add button doesn't get disabled and users can continue to add records. Any ideas of how I can enforce the limit still?

    #2
    getRecords() includes saved records only. Use getTotalRows()

    Comment


      #3
      Awesome, that worked! Thanks

      Comment

      Working...
      X