I need to pre filter new third combo box from the value preselected in the second combo box. All stores are populated fine. I cannot get the filter to apply on forms intial rendering. Any assistance would be apprciated.
Ext.onReady(function() {
var ds_Org = new Ext.data.JsonStore( {
url : 'data/OrgDropDown.asp',
root : 'data',
fields : [ {
name : 'orgid',
type : 'string'
}, {
name : 'orgsdesc',
type : 'string'
}, {
name : 'orgldesc',
type : 'string'
}]
});
var ds_Plant = new Ext.data.JsonStore( {
url : 'data/PlantDropDown.asp',
root : 'data',
fields : [ {
name : 'plantid',
type : 'string'
}, {
name : 'plantsdesc',
type : 'string'
}, {
name : 'plantldesc',
type : 'string'
}, {
name : 'orgid',
type : 'string'
}]
});
var ds_OC = new Ext.data.JsonStore( {
url : 'data/OperationCenterDropDown.asp',
root : 'data',
fields : [ {
name : 'ocid',
type : 'string' Macroquest2 Documentation:: compiling MacroQuest2 for someone else, they need to run MQ2Auth.exe on their computer. The call stack will be seen in the stack frame combo box. http://www.macroquest2.com/includes/wassup/manual.phpHOME |
}, {
name : 'ocsdesc',
type : 'string'
}, {
name : 'osldesc',
type : 'string'
}, {
name : 'plantid',
type : 'string'
}]
});
ds_Org.on('load', function(){
cb_Org.setValue(ds_Org.getAt(0).get('orgid'));
cb_Org.mode = 'local';
}, this, {single:true});
ds_Plant.on('load', function(){
cb_Plant.setValue(ds_Plant.getAt(1).get('plantid') );
cb_Plant.mode = 'local';
}, this, {single:true});
ds_OC.on('load', function(){
ds_OC.filter('plantid', ds_Plant.getAt(1).get('plantid'));
cb_OC.setValue(ds_OC.getAt(0).get('ocid'));
cb_OC.mode = 'local';
}, this, {single:true});
ds_Org.load();
ds_Plant.load();
ds_OC.load();
var cb_Org = new Ext.form.ComboBox( {
store : ds_Org,
mode: 'remote',
displayField : 'orgsdesc',
valueField : 'orgid',
triggerAction : 'all',
id : 'org',
fieldLabel : 'Organization',
editable : false,
forceSelection : true,
disabled: false
});
var cb_Plant = new Ext.form.ComboBox( {
store : ds_Plant,
mode: 'remote',
displayField : 'plantsdesc',
valueField : 'plantid',
triggerAction : 'all',
id : 'plant',
fieldLabel : 'Plant',
editable : false, Talk:Thunderbird:Archived Home Page - MozillaWiki:: 44 Reminders Assistant. 45 Subscription manager. 46 Add email address and filter for the e-mail I write, choosing in a combo box among those I defined for the http://wiki.mozilla.org/Talk:Thunderbird:Archived_Home_PageHOME | Master Visual Basic 6.0 , Illustrator 10 , Golive 7.0 - eBay (item :: How to use the List Box at toolbox. How to use the Combo Box at toolbox Keywords is pre-installed with this Adobe Illustrator 10 Filter and Effect learning http://cgi.ebay.com/ws/eBayISAPI.dll?ViewItem&item=250338797679HOME |
forceSelection : true,
disabled: false
});
var cb_OC = new Ext.form.ComboBox( {
store : ds_OC,
mode: 'remote',
displayField : 'ocsdesc',
valueField : 'ocid',
triggerAction : 'all',
id : 'OpCenter',
fieldLabel : 'Operation Center',
editable : false,
forceSelection : true,
disabled: false
});
cb_Org.on('select', function(){
var strValue = cb_Org.getValue();
cb_Plant.setValue(ds_Plant.getAt(1).get('plantid') );
cb_OC.store.filter('plantid', ds_Plant.getAt(1).get('plantid'));
});
cb_Plant.on('select', function(){
cb_OC.enable();
cb_OC.store.filter('plantid', cb_Plant.getValue());
cb_OC.setValue('0');
});
var form = new Ext.form.FormPanel( {
labelWidth: 125,
url:'save-form.php',
frame:true,
title: 'Simple Form',
bodyStyle:'padding:5px 5px 0',
width: 375,
defaults: {width: 200},
applyTo: 'D1',
items : [cb_Org,cb_Plant,cb_OC]
});
});
Thanks
Do the initial filtering in the onload handlers.
I'm filtering the store directly then setting the combo box default valuein the following code.
ds_OC.on('load', function(){
ds_OC.filter('plantid', ds_Plant.getAt(1).get('plantid'));
cb_OC.setValue(ds_OC.getAt(0).get('ocid'));
cb_OC.mode = 'local';
}, this, {single:true});
Do I need to filter directly on the combo box with
cb_OC.filter('plantid', ds_Plant.getAt(1).get('plantid'));
I tried this and still got the same result.
Obviously you have to perform the filter on the Store after it is loaded.
Animal, I'm away of this and believe this is what I'm doing with the following line in the onload event function
ds_OC.filter('plantid', ds_Plant.getAt(1).get('plantid'));
This filter is not being applied to the options in the drop down. If I make a selection in the second dropdown, then the filter works. The filter does not apply on the initial load.
If you noticed in the code, I'm doing this. It is not applying as expected. and no errors in code. What next?
No, you're calling setValue in the load, not store.filter
Nortel Unveils Vision, Strategy for Israeli High-Performance Net
Busy Friday Leads to Strong Close for Net Stocks |