paulio
10-22-2004, 09:48 PM
Good day all Here's my delima. i have an array of strings CSV (dataset)
i want to make a ComboBox dynamic from this array. (this array being a subset) from it's parrent.
//-- Begin code snipit ------------------------------
FSelectableListClass.prototype.makeDependent = function(multiDataProvider,master){
master.setChangeHandler("updateView",this);
this.multiDataProvider = multiDataProvider;
this.master = master;
};
FSelectableListClass.prototype.updateView = function(){
var selectedIndex = this.master.getSelectedIndex();
var dp = this.multiDataProvider[selectedIndex];
this.setDataProvider(dp);
}
cannedItem = new Array();
cannedItem [0] = "apple";
cannedItem [1] = "pear";
cannedItem [2] = "orange";
cannedItem [3] = "plum";
_root.attachMovie("FComboBoxSymbol","myComboBox1",1, {_x:5,_y:422} );
_root.attachMovie("FComboBoxSymbol","myComboBox2",2, {_x:5,_y:472});
theItemMainTypes = ["fruit","vegatables","Breads"];
myComboBox1.setDataProvider(theItemMainTypes);
theItemSubTypes = new Array();
theItemSubTypes.push([generateComboBoxData(cannedItem )]);
//-- the Above line is the one i am loosing my mind on. :)
theItemSubTypes.push(["carrot","lettuce","beans"]);
theItemSubTypes.push(["bread","bagel","muffin"]);
myComboBox2.makeDependent(theItemSubTypes,myComboB ox1);
//-- end code snipit ------------------------------
The generateComboBoxData(cannedItem) function returns the array as a sting like so: "apple","pear","orange","plum"
if i replace that above line with the values type in like so:
theItemSubTypes.push(["apple","pear","orange","plum"]);
Everything works perfectly.
I am about ready to toss my computer out the window and become a farmer. :)
I would be etarnally grateful if someone can point out the errors of my ways.
HELP ME>> :)
paul..
i want to make a ComboBox dynamic from this array. (this array being a subset) from it's parrent.
//-- Begin code snipit ------------------------------
FSelectableListClass.prototype.makeDependent = function(multiDataProvider,master){
master.setChangeHandler("updateView",this);
this.multiDataProvider = multiDataProvider;
this.master = master;
};
FSelectableListClass.prototype.updateView = function(){
var selectedIndex = this.master.getSelectedIndex();
var dp = this.multiDataProvider[selectedIndex];
this.setDataProvider(dp);
}
cannedItem = new Array();
cannedItem [0] = "apple";
cannedItem [1] = "pear";
cannedItem [2] = "orange";
cannedItem [3] = "plum";
_root.attachMovie("FComboBoxSymbol","myComboBox1",1, {_x:5,_y:422} );
_root.attachMovie("FComboBoxSymbol","myComboBox2",2, {_x:5,_y:472});
theItemMainTypes = ["fruit","vegatables","Breads"];
myComboBox1.setDataProvider(theItemMainTypes);
theItemSubTypes = new Array();
theItemSubTypes.push([generateComboBoxData(cannedItem )]);
//-- the Above line is the one i am loosing my mind on. :)
theItemSubTypes.push(["carrot","lettuce","beans"]);
theItemSubTypes.push(["bread","bagel","muffin"]);
myComboBox2.makeDependent(theItemSubTypes,myComboB ox1);
//-- end code snipit ------------------------------
The generateComboBoxData(cannedItem) function returns the array as a sting like so: "apple","pear","orange","plum"
if i replace that above line with the values type in like so:
theItemSubTypes.push(["apple","pear","orange","plum"]);
Everything works perfectly.
I am about ready to toss my computer out the window and become a farmer. :)
I would be etarnally grateful if someone can point out the errors of my ways.
HELP ME>> :)
paul..