Hybrid View

  1. #1
    Sencha User
    Join Date
    Dec 2010
    Posts
    14
    Vote Rating
    0
    seclar is on a distinguished road

      0  

    Default Refresh/reload a tree node

    Refresh/reload a tree node


    Hi,

    I've been porting an ext-js2 application to ext-js4 (what fun it's been!).

    I've managed most of it, but I've come a cropper on refreshing/reloading a tree node. We use trees for navigation, backed by a json treestore. Each node in the tree has a 'Refresh' option in its context menu. In version 2 this was a simple node.reload(); and how we loved it. However, that's gone away, for good reasons, I'm sure. My refreshHandler is setup in the 'itemcontextmenu' event, so:

    PHP Code:
    component.on('itemcontextmenu'onContextMenu); 
    and

    PHP Code:
    function onContextMenu(viewrecorditemindexeventeOpts) { 
    which ends up passing 'record' into the refreshHandler. From there, I can get at the store, so I followed the internet's advice and (where 'this' is 'record') called:

    PHP Code:
         this.store.load({ nodethis } ); 
    That greys out my tree and puts a 'Loading...' throbber on top of it. However, when I watch the network requests, I see no request being made, and the throbber never goes away.

    I've done most of the app by myself but now, please, help!

    Thanks,

  2. #2
    Sencha User
    Join Date
    Dec 2010
    Posts
    14
    Vote Rating
    0
    seclar is on a distinguished road

      0  

    Default


    There, I fixed it.

    PHP Code:
    refresh: {handler: function() { refreshHandler(view.getTreeStore(), record); }, scoperecord 
    PHP Code:
    function refreshHandler(somestoresomenode) {
        
    somestore.load({nodesomenode});