javascript - ExtJS ComboBox Uncaught TypeError: Cannot read property 'scrollIntoView' of null -
my ext version 4.07.
i create combobox , want store data json file.
var combo = ext.create(ext.form.combobox, { editable: false, fieldlabel: 'choose format', store: ext.create(ext.data.store, { autoload: true, fields: ['format', 'dimension'], proxy: { type: 'ajax', url: 'jsonurl', // has masked here reader: { type: 'json', root: 'formats' } }, listeners: { load: function(me) { var defaultvalue = me.getat(0).data.dimension; combo.select(defaultvalue); } } }), displayfield: 'dimension', valuefield: 'format', querymode: 'local', });
in case, did ajax call , loaded data when click combobox chrome developer tool console show error message: "uncaught typeerror: cannot read property 'scrollintoview' of null"
in firefox console show message: "typeerror: ext.fly(...) null ext.fly(child, '_scrollchildintoview').scrollintoview(this, hscroll);"
is there ideas fix problem?
thanks lot!
update:
i got problem. wrote load event , want set default value combobox set incorrect reference cause error message.
load: function(me) { //var defaultvalue = me.getat(0).data.dimension; //incorrect var defaultvalue = me.getat(0); //correct preferformat.select(defaultvalue); }
Comments
Post a Comment