Announcement

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

    Selecting unsaved rows in order to be able remove them

    Hey,

    I'm using SmartClient_v83p_2013-02-24.

    I have modal dialog with a ListGrid which contains rows. I allow the user to edit those rows and add new ones. All the changes will be sent to the server when the user close the dialog by clicking OK. I noticed that the new rows cannot be selected (as written in 'Handling Unsaved Records') but I want to allow the users to select them in order to be able to remove them if needed before saving the whole dialog. How can I do this? or if there is another solution for this problem I would love to hear.

    Thank you.

    #2
    Strange, you refer to the "Handling Unsaved Records" overview, and that overview offers a bulleted list of 3 different approaches for handling this problem. Please review those.

    Comment


      #3
      Well, the first option is not applicable in my case. The second one problematic because I need to load data to the grid from the server (for editing). The third option sound good but this sentence ("This means your server code will need to handle the fact that the ListGrid will submit "update" DSRequests for any subsequent edits.") make it impossible for me to use.

      So again, I have a modal dialog with ListGrid which contains data that the user can edit. Furthermore, the user should be able to insert and new rows to the grid (and remove them by selecting them). All the CUD operation should be sent to the server only when the user closes the dialog by clicking on the OK button.

      Please point me to the right method preferably with an example.

      Comment


        #4
        Your stated requirements are already fulfilled by the default behavior of autoSaveEdits:false - this doesn't allow selection for new rows, but you haven't indicated any requirements where this would be a problem.

        If you really do need selection for some reason you haven't stated, both the 1st and 3rd approaches in the doc seem viable.

        Comment


          #5
          All I need from you is a way to remove newly created rows which haven't been sent to the server yet (because I'm working with autoSaveEdits:false).

          Just to be clear, the user added two new rows but after adding them he want to remove one of them, how can I allow him to do it?

          Comment


            #6
            canRemoveRecords:true would allow both existing and new records to be deleted. Another approach would be a button or icon column that calls discardEdits() for the row.

            Comment


              #7
              Ok thank you I will take a look.

              Comment

              Working...
              X