:: Forum >> Version 2 >>
Tree Checkbox Event
Why when I click the tree sign it's changing the checkbox value at the same time? I only want the checkbox value to change when I click the checkbox??
This also serves as a good tree example with data, that I struggled to find on the support forum or in the documentation.
var Cattree = new Array;
var CattreeText = new Array;
var CattreeValue = new Array;//Checkbox code
Cattree[9] = [16,11,13,12];
CattreeText[16] = 'ACCESSORIES';
CattreeText[11] = 'BATTERIES';
CattreeText[13] = 'BRAKE PADS';
CattreeText[12] = 'SPARK PLUGS';
CattreeValue[16] = 'false';//Checkbox code
CattreeValue[11] = 'false';//Checkbox code
CattreeValue[13] = 'false';//Checkbox code
CattreeValue[12] = 'false';//Checkbox code
Cattree[10] = [15,14];
CattreeText[15] = 'GLOVES';
CattreeText[14] = 'HELMETS';
CattreeValue[15] = 'false';//Checkbox code
CattreeValue[14] = 'false';//Checkbox code
Cattree[0] = [9,10,18];
CattreeText[9] = 'PARTS';
CattreeText[10] = 'CLOTHING';
CattreeValue[9] = 'false';//Checkbox code
CattreeValue[10] = 'false';//Checkbox code
CattreeValue[18] = 'false';//Checkbox code
var MyTreeCheckboxCat = AW.Tree.Item.subclass();
MyTreeCheckboxCat.create = function(){
AW.Templates.Checkbox.create.call(this);
}
var treeCat = new AW.UI.Tree;
treeCat.setItemText(CattreeText);
treeCat.setViewCount(function(i){return Cattree[i] ? Cattree[i].length : 0});
treeCat.setViewIndices(function(i){return Cattree[i]});
treeCat.setSize(280,80);
treeCat.setItemTemplate(new MyTreeCheckboxCat); treeCat.setItemValue(CattreeValue);
treeCat.onItemClicked = function(event, index){clickCat(index);}
document.write(treeCat);
Jez (True Track Software)
Monday, January 3, 2011
Due to the checkbox being loaded as a template into the AW.UI.Tree, it appears the tree sign and the Checkbox share the same value...?
Can they be separated, this is quite an important factor...
Jez (True Track Software)
Monday, January 3, 2011
Bump
Friday, January 14, 2011
This topic is archived.
Back to support forum
Forum search