[CLOSED] Javascript - Update a Grid

  1. #1

    [CLOSED] Javascript - Update a Grid

    I posted a question on a TreeGrid to edit at the client - http://forums.ext.net/showthread.php...ing-a-TreeGrid

    I have the exact same scenario, but need to do it for a "regular" grid now. This is the original JS that works for the Tree is:
    /*********************************************************
     Document Reinsurer Grid - Update Tracking Dates
     setDates(storeColumnName as string)
    *********************************************************/
    function setDates(storeColumnName, newDate) {
        var rootNode = App.reinsurerTree.getRootNode();
    
        rootNode.cascadeBy(function (node) {
            //conditions: if the node is not the root, the node is selected and it is not the parent.
            if (node !== rootNode) {
                if (node.isLeaf() && App.reinsurerTree.selModel.isSelected(node)) {
                    node.beginEdit();
                    node.set(storeColumnName, newDate);
                    node.endEdit();
                }
            }
        }); 
    
       App.winDates.hide();
    }
    I just need to know the quivalent for a GridPanel.
    Last edited by Daniil; Sep 25, 2012 at 6:56 AM. Reason: [CLOSED]
  2. #2
    Hi,

    1. Please use
    grid.getStore().each(function (record) {
        ...
    });
    instead of
    rootNode.cascadeBy(function (node) {
    });
    2. This can be removed.
    if (node !== rootNode)
    3. This doesn't make any sense for the grid records.
    node.isLeaf()
    Hope this helps.

Similar Threads

  1. How Update control Ext: Label from Javascript
    By FAFNER in forum 1.x Help
    Replies: 2
    Last Post: Apr 07, 2011, 4:26 AM
  2. Replies: 0
    Last Post: Oct 15, 2010, 11:28 AM
  3. MenuPanel update items from javascript
    By Paul D in forum 1.x Help
    Replies: 2
    Last Post: Sep 23, 2010, 2:12 PM
  4. Replies: 0
    Last Post: Sep 22, 2010, 10:43 AM
  5. Update Tab URl with Javascript
    By alanp5 in forum 1.x Help
    Replies: 3
    Last Post: May 06, 2009, 3:33 PM

Tags for this Thread

Posting Permissions