Announcement

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

    Clear value in ListGrid cell

    In the following scenario, I have a ListGrid with fields that can be changed depending on user input. Currently fields = {f1} ...
    Code:
    1. User creates row in ListGrid and sets f1="1"
    2. User makes input elsewhere that causes fields to change. New fields = {f2}
        - App attempts to clear f1 values in existing records
            - Calls ListGrid.getRecords()
            - For each record, Record.setAttribute("f1", (String) null)
        - Calls ListGrid.setFields(newFields)
    3. User edits previous row and sets f2="2" (f1 is not displayed anymore)
    4. User action to save ListGrid with custom DMI
        - In the RPC tab of the dev console, it shows f1="1" and f2="2"
    I would like it to only show f2="2"

    I think the setAttribute(attr, null) is not working. How do I programmatically clear a value in a ListGrid cell/record?

    #2
    Your description is pretty ambiguous as to actual APIs being called, but it's possible that f2 has been established as an editValue by either the user entering it, or by a call to setEditValue(). In that case, it's not stored in the Record, and clearEditValue() is the right way to get rid of it.

    For more context, see the Grid Editing overview.

    Comment

    Working...
    X