Dojo Grid - Switching between editable and not editable

前端 未结 1 982
猫巷女王i
猫巷女王i 2021-02-10 23:59

I have a grid that will edit small chunks of data based on a larger tree structure. In order to make it easier to know what\'s being saved by the user, I want to have the grid b

1条回答
  •  日久生厌
    2021-02-11 00:11

    Figured this one out (though it took a bit). Turns out, that when you click on an entry in an editable grid, the grid goes into an editing state. (Makes sense.) However, when I saved the data store while the grid was in an editing state, it didn't change the state of the grid. The next time I clicked on edit and brought the grid back to where I thought I could start editing, the grid thought it was still editing the previously selected cell, and would only send that cells information.

    When I put the following code at the beginning of my saveTable and cancelTable methods, all worked as expected:

    if (containerGrid.edit.isEditing()) {
         containerGrid.edit.apply();
    }
    

    Hopefully, this answer can save someone else some time later.

    Thanks.

    0 讨论(0)
提交回复
热议问题