我的页面现在加载速度非常慢。基本上,我想预先填充我拥有的组合框。现在,它单独预填充每个,然后选择默认值。这太慢了。在页面完全加载之前,用户将不得不等待大约一分钟。
我正在获取值以从服务器填充组合框。预先选择组合框值的值通过响应变量在数组中接收。我如何加快整个过程?
代码如下:
EXTJS
xtype: "combo",
width: 250,
id: "nameId",
name: "comboName",
labelStyle: 'width:100px',
fieldLabel:"Name",
allowBlank: true,
displayField: "nameDisplay",
valueField: "nameValue",
url: "/thelink/toGetAllComboboxValues/fromPHPFile/",
return {
init: function (args) {
formPanel.on({
beforerender: function () {
Ext.Ajax.request({
url: 'url/to/another/PHP/file/',
scope: this,
method: 'GET',
params: {
code_id: 'myUser',
number: '12345'
},
success: function (response, opts) {
var result = Ext.decode(response.responseText);
Ext.getCmp('nameId').setValue(result.Name);
},
});
},
scope: this
});
//add form panel here
},
getFormPanel: function () {
return formPanel;
},
// load parameter values into the form
loadParams: function () {
},
goHome: function () {
},
};
}();
PHP 获取组合框值
//makes call to server for each individual combo box values
PHP 获取预选值
//grabs all pre-selected values based on an ID and puts them in an array