Announcement

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

    ListGrid navigateToNextRecord()

    Hi,

    I was required to implement a new navigation feature in our application, which is the following:

    I have a listGrid on top of which I end up opening a DynamicForm in which the current listGrid
    record is being edited. In that DynamicForm, I add a "Previous" and "Next" button that allows
    me to move the currently edited record without the need for closing the form and manually selecting
    a new "current" record in the listGrid and re-opening the edit form again (common design pattern). The
    underlying listGrid is always remains visible (underneath) and the currently selected record highlight
    moves accordingly.

    I noticed that ListGrid has a private method _navigateToNextRecord(). Why is that API private ? I ended
    up implementing the feature using the following sub-optimal calls into ListGrid's following methods:

    - bodyKeyPress({ keyName : 'Arrow_Up' });
    - bodyKeyPress({ keyName : 'Arrow_Down' });

    How would you recommend implementing this feature ? The way I did it works, but it seems odd to rely
    on those keyboard methods to do so ...

    Is there an easier way or more recommendable way ?

    Thanks,

    #2
    It seems like your Next/Previous buttons can be implemented with calls to startEditing() passing a new coordinate, and you can keep the form in synch with the currently editing row when it changes via keyPress by using the rowEditorEnter event. So no need for any internal access.

    Comment

    Working...
    X