PDA

View Full Version : TypeError when initializing Ext.util.History



gfrancis1@gmail.com
17 Oct 2012, 8:06 AM
I'm using Ext 4.0.2, and trying to 'fix' the back button for an Ajax-loaded page using Ext.util.History,
But when I put the following code on my page:



Ext.require(['Ext.util.History']);
Ext.util.History.init( function(){
Ext.util.History.on('change', function(token)
{
}
);
});


I get:

Uncaught TypeError: Cannot read property 'value' of null ext-all-debug.js:89797 (http://localhost:8081/tms/ext-4.0.2/ext-all-debug.js)

Ext.define.startUpext-all-debug.js:89797 (http://localhost:8081/tms/ext-4.0.2/ext-all-debug.js)
Ext.define.initext-all-debug.js:89858 (http://localhost:8081/tms/ext-4.0.2/ext-all-debug.js)
(anonymous function)ext-all-debug.js:89837 (http://localhost:8081/tms/ext-4.0.2/ext-all-debug.js)
(anonymous function)ext-all-debug.js:10122 (http://localhost:8081/tms/ext-4.0.2/ext-all-debug.js)
call

Any advice on what I'm doing wrong so far?

gfrancis1@gmail.com
18 Oct 2012, 6:49 AM
it was because I was missing
<form id="history-form" class="x-hide-display">
<input type="hidden" id="x-history-field" />
<iframe id="x-history-frame"></iframe>
</form>