-
28 Apr 2011 7:35 PM #1
[CLOSED]Ext.util.History and unable to hook-up change event
[CLOSED]Ext.util.History and unable to hook-up change event
I have a object (created in the onReady) that, in it's constructor, hooks up the change event for the History singleton object.
This is how I do it:
Ext.util.History.addListener('change', this.HandleHistoryChange(), this);
In FireBug this is the error I get in ext-all-debug.js:
Maybe I am doing something wrong here? My goal was to hook-up to the history change event so I know when the user clicks that back or forward button on the browser! This is the goal, maybe there it's more involved than just hooking into the change event? It would seem odd since there is already an instance created of History by the time I get into my onReady.Code:me.events is undefined [Break On This Error] me.events[ename] = me.events[ename] || true;
-
29 Apr 2011 7:23 AM #2
Try this one
Code:Ext.util.History.on('change', this.HandleHistoryChange, this);
-
30 Apr 2011 7:58 AM #3
I found in the examples this:
Call in onReady: Ext.History.init();
Also in my web page I needed:
So, it's working now. I still do not withdraw my bug report as I think the exception I was getting was very unhelpful, and sent me on a wild chase. Can't we have an exception, somewhere, that if you try and hook up the change listener, for History, if you have not called init or don't have the magic form code, that it will tell you this?Code:<form id="history-form" class="x-hide-display"> <input type="hidden" id="x-history-field" /> <iframe id="x-history-frame"></iframe> </form>
The same goes with using the .add method on History. If you don't do the magic setup, anything you do with this Singleton object is problematic? Am I right on that or wrong on that? Also, in the documentation this should be there telling you this!
-
1 May 2011 11:06 PM #4
I've added extra docs that:
a) Say that init() must be called before calling any History operation
b) Specify that the iframe/hidden field are required and have added some suggested markup.
I don't think it makes sense to add exceptions for every method in this specific case, especially since the docs are now much more clear on the matter.Evan Trimboli
Sencha Developer
Twitter - @evantrimboli
Don't be afraid of the source code!
-
2 May 2011 9:39 AM #5
Thanks for the update! The docs should, at least, get people far enough! Thanks
Thank you for reporting this bug. We will make it our priority to review this report.
Similar Threads
-
Collapse all ComboBox components when Ext.History's change event fires?
By paulcrowder in forum Ext 3.x: Help & DiscussionReplies: 1Last Post: 9 Mar 2011, 1:51 PM -
[DEFER-968] Ext.History.add() fires change event
By cnelissen in forum Ext 3.x: BugsReplies: 8Last Post: 29 Jul 2010, 8:55 AM -
Ext.History: 'change' event fired on Ext.History.add
By S1-Gezi in forum Community DiscussionReplies: 5Last Post: 18 Sep 2008, 8:10 AM


Reply With Quote