我的網頁現在加載速度非常慢。基本上,我想預先填充我擁有的組合框。現在,它預先填充每一個,然後選擇默認值。這太慢了。用戶在頁面完全加載之前必須等待一分鐘左右。組合框加載速度太慢
我抓住值從服務器填充組合框。預先選擇組合框值的值通過響應變量接收到數組中。我如何加速整個過程?
代碼如下:
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獲取COMBO框中的值
//makes call to server for each individual combo box values
PHP獲取預選VALUES
//grabs all pre-selected values based on an ID and puts them in an array
準確地使用了什麼版本的Extjs(直到次要版本,例如:4.1.0)?另外,每家店鋪有多少條記錄?回答這些問題將有助於我們更詳細地瞭解您的情況。 – Reimius