1
我正在使用兩個面板的Tabpanel,我通過JSON檢索數據。在第一個tabpanel中檢索數據似乎效果很好,但是,我無法解析從第二個tabpanel中的JSON檢索到的數據。有任何想法嗎?ExtJS Tabpanel和JSON數據沒有加載?
var registrationformPanel = new Ext.form.FormPanel({
frame:true,
border:true,
labelWidth: 125,
url:'content/registercompany/registercompany.php?mode=createRegistercompany',
sortInfo:{field: 'company_id', direction: "ASC"},
reader: new Ext.data.JsonReader({
root: 'results'
}, [
{name: 'company_id', sortType : 'int'},
{name: 'company_name'},
{name: 'orgno'},
{name: 'firstname'},
{name: 'lastname'},
{name: 'address1'},
{name: 'postalcode'},
{name: 'postalarea'},
{name: 'phone1'},
{name: 'mobile'},
{name: 'fax1'},
{name: 'email'},
{name: 'www'},
{name: 'bankaccount'},
{name: 'member_password'},
{name: 'member_confirm_password'},
{name: 'butikknummer'}, {name: 'bransje'},
{name: 'kommentar'},
{name: 'apningstider_hverdag'},
{name: 'stengetider_hverdag'},
{name: 'apningstider_helg'},
{name: 'stengetider_helg'},
{name: 'butikk_navn'},
{name: 'butikk_addresse'},
{name: 'butikk_telefon'},
{name: 'butikk_poststed'},
{name: 'butikk_postnummer'}
]),
items: [{
// {
xtype:'tabpanel',
plain:true,
activeTab: 0,
height:405,
// defaults:{bodyStyle:'padding:15px'},
defaults:{bodyStyle:'padding:10px'},
items:[{
title:'Firmainformasjon',
//layout:'form',
//layout:'column',
layout:'column',
defaults: {width: 200},
//defaultType: 'textfield',
items: [{
columnWidth:.50,
layout: 'form',
items: [
company_id,
butikk_navn,
company_name,
orgno,
firstname,
lastname,
address1,
postalcode,
postalarea,
butikknummer,
kommentar
// apningstider_hverdag,
// stengetid_hverdag
]
},{
columnWidth:.50,
layout: 'form',
items: [
phone1,
mobile,
fax1,
email,
www,
bankaccount,
member_password,
member_confirm_password
//bransje
]
}]
},{
title:'Butikkinformasjon',
//layout:'form',
//layout:'column',
layout:'column',
defaults: {width: 200},
//defaultType: 'textfield',
items: [{
columnWidth:.50,
layout: 'form',
items: [
//butikk_navn,
butikk_addresse,
butikk_poststed,
apningstider_hverdag,
stengetider_hverdag
]
},{
columnWidth:.50,
layout: 'form',
items: [
butikk_telefon,
butikk_postnummer,
apningstider_helg,
stengetider_helg,
bransje
]
}]
}]
和:
if(id!="" && id!="[object Object]" && id!=undefined)
{
registrationformPanel.form.load({url:'content/registercompany/registercompany.php?mode=editRegistercompany&id='+id,
waitMsg:'Loading'});
}
您是否在Firebug或Chrome的調試器中運行此操作,並檢查是否有任何報告的錯誤?此外,這段代碼片段似乎不完整,我看到你有一個JsonReader,但是有沒有FormPanel的Store?從哪裏抓取數據? – 2010-08-12 22:26:43