14 Aug 2012 3:31 AM #1
Unanswered: How to refresh or re-render TreePanel ExtJS4?
I have a list of records in a tree panel ExtJS4.
I can delete a record through delete button below the treepanel. After the delete service is sent to the server, refreshed data is collected in treestore of the treepanel. But when I load the store through Ext.applyand then refresh the view of the treepanel, then too the tree is not refreshed, i.e. I can still see the deleted record.
The record gets removed from the panel when I re-login into the application, ie. tree is not getting refreshed.
Please find below code (I have tried all the below codes but the screen is not getting refreshed):
14 Aug 2012 4:35 AM #2
Reloading your TreePanel's store should be as easy as:
I'd eliminate possibility #2 first by sprinkling a little logging code in the server-side method which performs the delete and use Firefox/Firebug or Chrome Developer tools to inspect the response to the client to ensure that data for the deleted record is not present.
14 Aug 2012 5:00 AM #3
Thanks for replying friend.
I've already tried it. But treestore's load method throws error. (a is undefined)
Moreover browser isn't caching the JSON response, neither is the server request failing.
As soon as the server request gets fired, I debugged the code on server class and store data on Firebug. In both cases the data is correct and updated.
14 Aug 2012 9:16 AM #4
- Join Date
- Jul 2010
- Houston, Tx
- Vote Rating
Are there any errors in the console?
What is your header/response .. any errors on the server? do you get a response?
This should be straight forward.
14 Aug 2012 7:58 PM #5
Thanks for replying Scott martin.
There isn't any error on the console. And to delete a record, the command fired does not gives back any response. It only gives a success or error code stating whether the record is deleted or not. In my case it gives a success code.
To retrieve the fresh data I had fired the same command which I initially did to load the tree panel. After this command is fired, I can see the new data in store as well as in tree but tree does not gets refreshed somehow.