-
August 10th, 2012, 02:01 PM
#1
calculate cells
Hi ,
i need to calculate the sum of some cells
to do that i use the code
var itemsArray = stocksGrid.extractItemList();
var sumCell = new Number(0);
for (var i in itemsArray) {
var c = stocksGrid.getValue(itemsArray[i],"o_Bid");
if (c==null) c=0;
var val = new Number(c).toFixed(4);
sumCell += Number(val);
}
for the cells that are feed data from server works fine
the problem is when i have cells with custom-data
like
var calc1 = A*B;
info.setCellValue("#Cell01",calc1.toFixed(4));
var itemsArray = stocksGrid.extractItemList();
var sumCell = new Number(0);
for (var i in itemsArray) {
var c = stocksGrid.getValue(itemsArray[i],"#Cell01");
if (c==null) c=0;
var val = new Number(c).toFixed(4);
sumCell += Number(val);
}
Thanks
-
August 13th, 2012, 09:59 AM
#2
Hi betasec,
Note that setCellValue does not update the internal model of the AbstractGrid so that if a value is set through this method it can't be used for features working on such model.
Please replace setCellValue statement with UpdateRow; e.g.:
-
August 13th, 2012, 12:11 PM
#3
Hi
this works fine
Thanks
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
All times are GMT +1. The time now is 01:54 AM.
Bookmarks