After reading what Simeon from Simfluence wrote today, I started playing with his example and I modified a little bit his code. Some of the changes I made are that I keep the data in the global scope instead of the shared object and maintain the row numbers on the grid. Here is the result.
After reading what Simeon from Simfluence wrote today, I started playing with his example and I modified a little bit his code. Some of the changes I made are that I keep the data in the global scope instead of the shared object and maintain the row numbers on the grid. Here is the result. And the code:
rs = queryNew("id,fname,lname,dept,email");
addRow(rs, 'simeon','bateman','IT','[email protected]');
addRow(rs, 'Mr','Man','HR','[email protected]');
addRow(rs, 'Cool','Guy','HR','[email protected]');
addRow(rs, 'Another','test','Customer Service','[email protected]');
function addRow( qry, fname, lname, dept, email){
queryAddRow(rs);
querySetCell(rs,'fname',fname);
querySetCell(rs,'lname',lname);
querySetCell(rs,'dept',dept);
querySetCell(rs,'email',email);
}
SELECT distinct dept
FROM rs
ORDER BY dept
SELECT * from rs
ORDER BY dept
if(_global.arrMembers == undefined) _global.arrMembers = data.dataProvider.slice(0);
var arrMembers = _global.arrMembers;
var arrDisplay:Array = [];
for(var i = 0; i < arrMembers.length; i++)
{
if(arrMembers[i].dept == myselect1.value || myselect1.value == 'All')
{
arrDisplay.push(arrMembers[i]);
}
}
data.dataProvider = arrDisplay;