Announcement

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

    ListGrid SelectRecord when primaryKey is null

    I have a ListGrid with a datasource. The datasource defines a primaryKey but the listGrid save locally, and thus rows do not inherit their primaryKey until after a save event.
    This design is working great with one exception. grid.selectRecord does not like rows without primaryKeys, it only ever selects the top row of the grid when no primary keys are present.
    I was hoping that grid.selectRecord when given an index rather than a record would still work but it does not.

    Is there another method I could use to select a row when I know it's index?

    SmartClient Version: v10.0p_2015-12-02/Pro Deployment (built 2015-12-02)

    #2
    You either need to provide primaryKey values for all the records, or not declare a primaryKey. What you're doing right now is setting an expectation that the records have primaryKeys, but then not actually providing them, hence the issue you've got. If you don't declare a primaryKey, then records can be selected by index or by object identity.

    Bear in mind that, as far as providing primaryKey values, they need not be real primaryKeys. It can be just an increasing number, so long as you keep it unique for all records during that browser session.

    Comment


      #3
      That's what I figured I would probably have to do, thanks for your help

      Comment

      Working...
      X