Announcement

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

    ListGrid group rows need to be editable.

    Be sure your post includes:

    1. isomorphic/system/modules/ISC_Core.js?isc_version=v9.0p_2013-11-03.js

    We have a requirement that the rows in a ListGrid need to be grouped by 1 column, and have the ability to have editable fields in the group header row. We do not see the option to make this happen please advice on what object/properties we should use to accomplish this requirement.

    #2
    The Group Header row is non editable by default as it doesn't actually represent any data in the grid - it's just a "header" for the various records within that group.

    If you are actually dealing with hierarchical data, you could make use of a TreeGrid where folders are editable.

    If you have some use case where this UI does make sense which we're not seeing, please let us know at a high level what you're trying to achieve and we may be able to point you in the right direction.

    Regards
    Isomorphic Software

    Comment


      #3
      collapsed parent nodes

      We have changed the ListGrid to a TreeGrid, but we want to be able to change data in the editable fields on the parent node row and have that change cascade down to the children of that node. How do we cascade the change to all children of the parent node if that parent node is collapsed?

      Comment


        #4
        You can simply use DataSource operations, like DataSource.updateData(), to update nodes that are not shown.

        If all the nodes have been loaded, you can access them via Tree APIs like getChildren() - listGrid.data is an instance of Tree for a TreeGrid.

        Comment


          #5
          To be able to cascade the change down to the children of the parent node I need to be able to edit the 'edited node' not the primary node data. So that updateDate() can see there has been changes made to that node and send it. We are not saving every change individually, instead we are sending all of the edited rows to the update method on the server. With the ListGrid we have methods like getAllEditRows() but I do not see this or anything like this in a TreeGrid or Tree, How do we get access to proceduralley make edits to children nodes that are collapsed into their parent?

          Comment


            #6
            TreeGrid is a subclass of ListGrid, so getAllEditRows() is still available, along with all other editing-related APIs from ListGrid. In particular, setEditValues() is how you programmatically cause edits to be stored for a row. However, this isn't allowed for records that aren't loaded, and for rows that aren't visible, there is also the issue of not having a place to show validation errors or other problems with the save.

            Overall, edits that are not visible to a user are a usability issue. We would recommend re-designing your intended UI here - either showing the entire tree fully expanded and not allowing collapse, in which case you can use setEditValues() as normal, or if you insist on hidden edits, coming up with your own separate way of tracking edits, since the built-in edit tracking system intentionally disallows hidden edits.

            Comment


              #7
              Is there a callback for TreeGrid.getData().openAll() method? We want to call a function once all the nodes are opened.

              Comment


                #8
                If all the data is loaded at once (easiest to enable this via loadDataOnDemand:false), then as long as you've performed the fetch, openAll should be synchronous.
                You can also send data to the client already in "open" state by setting the 'openProperty' on your folder nodes on the server side.

                If you're loading on demand as nodes are opened, openAll may reveal unloaded child nodes. You could wait for dataArrived / dataChanged on your ResultTree, or you could instead use Tree.isLoaded() / ResultTree.loadChildren(<node>, <callback>) to ensure the children are loaded before calling the "open" method.
                However, if you're planning to have all nodes be open, setting loadDataOnDemand to false would seem to be the more sensible option.

                Comment


                  #9
                  The TreeGrid is already loaded and the parent nodes are modified. When the user makes some action, we want to expand all nodes to show the users what is modified. Hence we want someway of callback event that can be fired after all nodes in the grid is opened.

                  Comment


                    #10
                    If the nodes are all loaded, then openAll should be synchronous*, so no callback is required - you can simply carry on with your actions in the same thread after calling openAll() and the row number indices etc should instantly be correct for the fully opened tree

                    *Technically a delayed redraw may occur - this wouldn't impact your code in most cases but if for some reason it seems to, you could always call an explicit "redraw()" if "isDirty()" returns true on the item, to force the redraw to occur synchronously in the same thread.

                    Comment

                    Working...
                    X