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

    expansionEditorCollapseOnSave seems to be ignored when autoSaveEdits is true

    For this particular situation I use the latest SmartClient 11.1 Pro version, but I think it also fails on newer versions (unless it is intended behavior).

    When using the expansionMode: "editor" for ListGrid, it seems expansionEditorCollapseOnSave is not honored when the grid's autoSaveEdits property is true (the default). I pinpointed this down to the isExpanded() method which does check a "_expanded" + this.ID property of the record, but that gets overridden by my server (RubyOnRails) when returning the record.
    Last edited by wallytax; 27 Nov 2023, 05:26.

    Sorry, are you saying that you want values to be saved and they aren't, or the other way around?

    Also, you seem to be saying your overwriting the expansion state.. so does that mean that you've found that if you don't do that, then things work as you want?


      I will explain better what I want. I have a grid with some fields and one of those fields is a "Remarks" fields that might be quite long, so I use an icon to indicate the user there are remarks and when he hovers over it, the remarks are shown. But in this particular case the user needs to be able to only edit those remarks. I've tried an approach with a modal window and then showed the customer an option to expand the row which he really liked. I've tried to create something myself but failed to be able to close the expansion after saving. Then I found out about the built-in "editor" expansion mode and tried that. But even then, the collapse didn't work.

      So my question would be? How to create in-line editing of a text field in a List Grid easily? A built-in pop-up would also be acceptable.


        The default for editing a long text field (over the default threshold of 255) is to use the longTextEditorType, which is basically a little pop-up window.

        So perhaps your "remarks" field doesn't have a declared length - if you declare it, and it's over 255, the default editing experience is pretty much like you want.

        If you want to return to the expansion concept, we still need our questions answered: we still need to know whether you want a save to happen or not (and when), and what specifically is going wrong (JS error? No save is triggered? Save is triggered but fails?), and also need to know whether you are overwriting the internal state that the grid uses to track expansion status.


          Thanks for pointing me into the right direction! I don't show the actual text in the grid, but only an icon indicating there's text with a hover displaying the actual text. But I now set the "editorType" property to "PopUpTextAreaItem" and then I'm able to use the normal in-grid editing which is exactly what I want. No need for the expansion record anymore.

          So I don't think it's necessary to answer your last question then since it's not applicable anymore. But if you want to know if anything is going wrong, then I'm willing to answer it a bit without further testing.