Hi,
We are using a TreeGrid and set customIconProperty for that to have different icons for each Node. Thats working fine.
In a particular case we weed to update a Node values ( along with Node Icon )dynamically.
We have used setEditValues() and refreshRow() combination. By doing so we can able to change all the display values but other than Node Icon.
We saw other post with the same problem and what you have suggested is using
refershCell. We have tried the same but that is not solving our need.
Here is the sample program that depics our need.
We have modified Tree -> Initial Data example in SmartClient Explorer
isc.TreeGrid.create({
ID: "employeeTree",
width: 500,
height: 200,
dataSource: "employees",
customIconProperty:"myIcon",
showOpenIcons:false,
showDropIcons:false,
closedIconSuffix:"",
fields: [
{name: "Name"},
{name: "Job"}
],
dataProperties: {openProperty: "isOpen"},
initialData: [
{EmployeeId:"4", myIcon:"icons/16/person.png", ReportsTo:"1", Name:"Charles Madigen", Job:"Chief Operating Officer",
isOpen: true},
{EmployeeId:"192", myIcon:"icons/16/person.png", ReportsTo:"4", Name:"Ralph Brogan", Job:"Mgr Software Client Supp"},
{EmployeeId:"191", myIcon:"icons/16/person.png", ReportsTo:"4", Name:"Tammy Plant", Job:"Mgr Cap Rptg Dist"},
{EmployeeId:"190", myIcon:"icons/16/person.png", myIcon:"icons/16/person.png", ReportsTo:"4", Name:"Carol Finley", Job:"Mgr Fin Rpts Budgets"},
{EmployeeId:"189", myIcon:"flags/16/US.png", ReportsTo:"4", Name:"Gene Porter", Job:"Mgr Tech Plng IntIS T"},
{EmployeeId:"188", myIcon:"flags/16/US.png", ReportsTo:"4", Name:"Rogine Leger", Job:"Mgr Syst P P"},
{EmployeeId:"187", myIcon:"flags/16/US.png", ReportsTo:"4", Name:"Abigail Lippman", Job:"Mgr Proj Del"},
{EmployeeId:"186", myIcon:"flags/16/US.png", ReportsTo:"4", Name:"John Garrison", Job:"Mgr Site Services"}
]
});
isc.IButton.create({
top:210,
title:"Change Values",
click:function(){
var rowNum = employeeTree.getRecordIndex(employeeTree.data.find('EmployeeId',191));
employeeTree.setEditValues(rowNum,{EmployeeId:"191", myIcon:"flags/16/US.png", ReportsTo:"4", Name:"Changed for Testing", Job:"Changed for Testing"});
employeeTree.refreshRow(rowNum);
var colNum = employeeTree.getFieldNum('Name');
employeeTree.refreshCell(rowNum,colNum);
}
});
in this example ,we need to upate the Node Icon for the Node with primary key 191 as ‘flags/16/US.png’.
How to do this? Help us.