PDA

View Full Version : Why three level linkage combo can not success in FireFox



lightyear416
31 Oct 2012, 12:37 AM
Hi,everyone.I write a three level linkage combo example.I can do it in IE9 and Chrome,but when I do it in FireFox,The third combo can not show content.I have found the json data in firebug,but I don't know why the content can not bind to combo.

function Sensor_Cable_Relation_Panel(objnum, objname, url, opr) { Monitor_Cable_Token = 1;
Monitor_Cable_DTSCombo_Url = '';
Monitor_Cable_DTSChannelCombo_Url = '';
Monitor_Cable_DTSSectionGrid_Url = '';
var sectionlist = "";

var cable_relation_panel = Ext.create('Ext.form.Panel', {
id: 'cable-relatepanel',
url: url,
width: 400,
height: 320,
border: false,
autoDestroy: true,
defaults: {
xtype: 'textfield',
anchor: '98%',
msgTarget: 'side',
padding: 2,
labelWidth: 120
}, //WES_ComboClass
items: [
{ hidden: true, allowBlank: true, fieldLabel: '关联ID', name: 'Num', id: 'num-field' },
{ hidden: true, allowBlank: true, fieldLabel: '传感器ID', name: 'ObjNum', id: 'objnum-field', value: objnum },
{ hidden: false, xtype: 'displayfield', fieldLabel: '传感器', name: 'ObjName', id: 'objname-field', value: objname },
{ xtype: 'combo', fieldLabel: 'DTS类型', id: 'dtstypeclass', valueField: 'DTSTypeID', displayField: 'DTSTypeName',
store: Ext.create('Ext.data.Store', {
autoLoad: true,
model: 'DTS_Type_ComboClass',
fields: ['DTSTypeID', 'DTSTypeName'],
proxy: {
type: 'ajax',
url: 'Config/Device/DTS.aspx?method=dtstype_combo',
reader: {
type: 'json',
root: 'data'
}
}
}),
triggerAction: 'all',
editable: false,
emptyText: "请选择DTS设备类型",
listeners: {
'change': function (field, newvalue, oldvalue) {
if (newvalue != null || newvalue != "") {
if (!(opr == 'edit' && Monitor_Cable_Token == 1)) {
//alert(Ext.getCmp('areaclass').getValue());
Ext.getCmp('dtstypeid-field').setValue(Ext.getCmp('dtstypeclass').getValue().toString());


Ext.getCmp('dtsclass').setRawValue("");
Ext.getCmp('dtsid-field').setValue("");
Monitor_Cable_DTSCombo_Url = 'Config/Config.aspx?method=dts_combo&dtstypeid=' + newvalue;
Ext.getCmp('dtsclass').getStore().proxy.url = Monitor_Cable_DTSCombo_Url;
Ext.getCmp('dtsclass').getStore().load();


Ext.getCmp('dtschannelclass').setRawValue("");
Ext.getCmp('dtschannelid-field').setValue("");
Monitor_Cable_DTSChannelCombo_Url = '';
Ext.getCmp('dtschannelclass').getStore().proxy.url = Monitor_Cable_DTSChannelCombo_Url;
Ext.getCmp('dtschannelclass').getStore().load();


Monitor_Cable_DTSSectionGrid_Url = '';
Ext.getCmp('relate_section_grid').getStore().proxy.url = Monitor_Cable_DTSSectionGrid_Url;
Ext.getCmp('relate_section_grid').getStore().load();
sectionlist = "";
Ext.getCmp('sectionlist-field').setValue(sectionlist);
}
}
}
}
},
{ hidden: true, allowBlank: false, fieldLabel: 'DTS类型ID', name: 'DTSTypeID', id: 'dtstypeid-field' },
{ xtype: 'combo', fieldLabel: 'DTS设备', id: 'dtsclass', valueField: 'HostNum', displayField: 'HostName',
store: Ext.create('Ext.data.Store', {
autoLoad: false,
model: 'DTS_ComboClass',
fields: ['HostNum', 'HostName'],
proxy: {
type: 'ajax',
url: Monitor_Cable_DTSCombo_Url,
reader: {
type: 'json',
root: 'data'
}
}
}),
triggerAction: 'all',
editable: false,
emptyText: "请选择DTS设备",
listeners: {
'change': function (field, newvalue, oldvalue) {
if (newvalue != null || newvalue != "") {
if (!(opr == 'edit' && Monitor_Cable_Token == 1)) {
//alert(Ext.getCmp('areaclass').getValue());
//alert("!!");
Ext.getCmp('dtsid-field').setValue(Ext.getCmp('dtsclass').getValue().toString());


Ext.getCmp('dtschannelclass').setRawValue("");
Ext.getCmp('dtschannelid-field').setValue("");
Monitor_Cable_DTSChannelCombo_Url = 'Config/Config.aspx?method=dts_channel_combo&hostnum=' + newvalue;
Ext.getCmp('dtschannelclass').getStore().proxy.url = Monitor_Cable_DTSChannelCombo_Url;
Ext.getCmp('dtschannelclass').getStore().load();
//Ext.getCmp('dtschannelclass').select(1);


Monitor_Cable_DTSSectionGrid_Url = '';
Ext.getCmp('relate_section_grid').getStore().proxy.url = Monitor_Cable_DTSSectionGrid_Url;
Ext.getCmp('relate_section_grid').getStore().load();
sectionlist = "";
Ext.getCmp('sectionlist-field').setValue(sectionlist);
}
}
}
}
},
{ hidden: true, allowBlank: false, fieldLabel: 'DTSID', name: 'HostNum', id: 'dtsid-field' },
{ xtype: 'combo', fieldLabel: '所属通道', id: 'dtschannelclass', valueField: 'ChannelNum', displayField: 'ChannelName',
store: Ext.create('Ext.data.Store', {
autoLoad: false,
model: 'DTS_Channel_ComboClass',
fields: ['ChannelNum', 'ChannelName'],
proxy: {
type: 'ajax',
url: Monitor_Cable_DTSChannelCombo_Url,
reader: {
type: 'json',
root: 'data'
}
}
}),
triggerAction: 'all',
editable: false,
emptyText: "请选择通道",
listeners: {
// 'expand': function (field) {
// alert(field.getStore().proxy.url);
// //field.getStore().load();
// },
'change': function (field, newvalue, oldvalue) {
if (newvalue != null || newvalue != "") {
if (!(opr == 'edit' && Monitor_Cable_Token == 1)) {
//alert(Ext.getCmp('areaclass').getValue());
///alert("!!!");
Ext.getCmp('dtschannelid-field').setValue(Ext.getCmp('dtschannelclass').getValue());


Monitor_Cable_DTSSectionGrid_Url = 'Config/Config.aspx?method=dts_section_list&channelnum=' + newvalue + '&objnum=' + objnum;
Ext.getCmp('relate_section_grid').getStore().proxy.url = Monitor_Cable_DTSSectionGrid_Url;
Ext.getCmp('relate_section_grid').getStore().load({
scope: this,
callback: function (records, operation, success) {
sectionlist = "";
Ext.getCmp('sectionlist-field').setValue(sectionlist);
}
});
}
}
}
}
},
{ hidden: true, allowBlank: false, fieldLabel: '通道ID', name: 'ChannelNum', id: 'dtschannelid-field' },
{ hidden: true, allowBlank: false, fieldLabel: '选中区段', name: 'SectionList', id: 'sectionlist-field' },
{
xtype: 'grid', title: '可供关联区段表', width: 300, height: 200, id: 'relate_section_grid',
store: Ext.create('Ext.data.Store', {
model: 'dts-segment-model',
proxy: {
type: 'ajax',
url: Monitor_Cable_DTSSectionGrid_Url,
reader: {
type: 'json',
root: 'data'
}
},
autoLoad: false
}),
columns: [
{ text: '区段编号', dataIndex: 'SectionNum', sortable: false, hidden: true, width: 30 },
{ text: '通道编号', dataIndex: 'ChannelNum', sortable: false, hidden: true, width: 30 },
{ text: '区段名称', dataIndex: 'SectionName', sortable: false, hidden: false, flex: 1 },
{ text: '起始位置', dataIndex: 'BegPos', sortable: false, hidden: false, flex: 1 },
//{ text: '是否旁路', dataIndex: 'EndPos', sortable: false, hidden: true, width: 55, renderer: bypasstoken },
{text: '截止位置', dataIndex: 'EndPos', sortable: false, hidden: true, flex: 1 }
],
selModel: Ext.create('Ext.selection.CheckboxModel', {
listeners: {
selectionchange: function (sm, selections) {
//Ext.getCmp('relate_raster_grid').setDisabled(selections.length == 0);
if (!(opr == 'edit' && Monitor_Cable_Token == 1)) {
sectionlist = "";
//alert("!!!!");
if (selections.length != 0) {
for (var i = 0; i < selections.length; i++) {
if (i != selections.length - 1)
sectionlist = sectionlist + selections[i].get('SectionNum') + ",";
else
sectionlist = sectionlist + selections[i].get('SectionNum');
}
}
Ext.getCmp('sectionlist-field').setValue(sectionlist);
}
}
}
})
}
]
});


return cable_relation_panel;
}

kevin.chen
1 Nov 2012, 6:23 PM
I saw your store configuration include both model and fields, does your returned data follow fields definition or model definition

lightyear416
5 Nov 2012, 2:11 AM
Yes,I do check the post and response,the data and form of json are both right.There is not error.Is there something wrong I ignore?

kevin.chen
5 Nov 2012, 10:51 AM
usually, when you configure a store, if you use model property, you don't need to use fields property, if you use fields, you don't need model, can you remove one of them?

lightyear416
5 Nov 2012, 5:58 PM
I don't think so.I use it perfectly on IE9 and chrome.When I move model or field the data can not show in any way.

kevin.chen
5 Nov 2012, 6:07 PM
I think you should work on the new issue after you remove the field or model