Announcement

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

    How to track changes to a nested RecordList in each ListGridRecord

    I have a ListGrid that is populated with records and with setAutoSaveEdits(false). One of the fields in each grid record is a nested RecordList containing related child records.

    I'm using other UI components to edit the nested child records in each ListGrid record and I want to track those pending changes like any other field in the main ListGrid record, so that those changes are recognized when I call saveAllEdits().

    If it was a simple text field I would use grid.setEditValue(rowNum, "childField", newValue) but there is no version of setEditValue that takes a Record[] as the newValue parameter.

    Is there another way to apply changes to the nested child records so that the main grid record is flagged for update when I call grid.saveAllEdits()?
    Last edited by jay.l.fisher; 29 Nov 2010, 12:11.

    #2
    Any advice here? I've tried just getting the grid data as a record list and then setting the value on the record, but the updated data in that case gets sent to the server as an oldValue().

    Comment


      #3
      Sorry, forgot to update the thread. You should be allowed to set a whole Record or Record[] as an editValue, and those APIs have just been added.

      Comment


        #4
        is this added to LGPL version ? where can I see it. Thanks.

        Comment


          #5
          http://www.smartclient.com/builds

          Comment


            #6
            I see the new API and am able to store the new Record[] as an edit value. But if I then use getEditValue() the Object returned is a JavaScriptObject which cannot be cast back into a Record[]. How do I get access to the edit value as a Record[]?

            Comment


              #7
              Hi Jay
              For now you can use JSOHelper convertToRefDataClassArray(JavaScriptObject editVals); to achieve this.
              We're looking at how to make this simpler, probably by adding type-specific getters [getEditValuesAsRecordArray() etc or similar]

              Comment

              Working...
              X