9 Jun 2010 7:00 AM #1
Using URL's hash and history
I am trying to build a big application that will require URL to be working even if the application is totally driven by AJAX. I am using the hash part of the URL to indicate when the location change and using Ext.History I can be notified properly when the back/forward buttons of the browser is used.
This is all fine, yet, my issue is about the first load. What method must I used to initialize a tab, tree or grid panel to properly select the choice indicated inside the hash string?
It seems that Ext.History change event only fired up when it change after the initial load, and it seems that each panels (tree, tab, grid) have their own method to handle selection which is kind of a pain, and even tree have 2, if you load the nodes statically the TreeLoader load event isn't fired but if you do it using a remote AJAX to load the nodes then they event is fired.
Is there a recommended method to have the different panels set their initial state based on the actual history when the first load is executed? What does expert in ext js recommend?
My current method is that I subclass the tab panel for example and listen for history change, and on the initial load I retrieve the id/value pair from the current location to set the initialTab. For a tree, I register on both the history change and the loader load and this works fine for asynch loaded tree but not static one (where all the node are in the js code).
And I need a solution to grid as well.
By ahmadfareed in forum Ext 3.x: Help & DiscussionReplies: 0Last Post: 10 Feb 2010, 10:14 PM
By denkoo in forum Ext 2.x: Help & DiscussionReplies: 0Last Post: 11 Feb 2009, 9:57 PM
By randomuser01 in forum Ext 2.x: Help & DiscussionReplies: 1Last Post: 22 Oct 2008, 12:13 PM
By DTT_11-1983 in forum Ext 2.x: Help & DiscussionReplies: 0Last Post: 19 Sep 2008, 2:44 AM
By maccman in forum Ext 1.x: Help & DiscussionReplies: 1Last Post: 24 Apr 2007, 8:36 AM