0

次のように Ext History を初期化しようとすると、Ext 4.0.7 を使用しています。

Ext.require(['Ext.util.History']);

Ext.onReady(function(){  

   Ext.util.History.init();

});

私が得る:
Uncaught TypeError: Cannot read property 'value' of null ext-all-debug.js:89797
Ext.define.startUp ext-all-debug.js:89797
Ext.define.init ext-all-debug.js: 89858
(匿名関数) dashboard.js:5
(匿名関数) ext-all-debug.js:10122
call ext-all-debug.js:10078

私が間違っているかもしれないアイデアはありますか?

4

1 に答える 1

1

4.1x より前では、DOM が適切に機能するためには、DOM に非表示のフォームが必要でした。私の提案は、4.1x にアップグレードするか、次のように init() の前に呼び出す初期化ルーチンを追加することです。

 initialiseHistory: function () {
 this.historyForm = Ext.getBody().createChild({
 tag:    'form',
 action: '#',
 cls:    'x-hidden',
 id:     'history-form',
 children: [
 {
 tag: 'div',
 children: [
 {
 tag:  'input',
 id:   Ext.util.History.fieldId,
 type: 'hidden'
 },
 {
 tag:  'iframe',
 id:   Ext.util.History.iframeId
 }
 ]
 }
 ]
 });
 }
于 2012-10-17T20:42:11.753 に答える