:: Forum >>

How do I replace the values partially in a cell?

The grid data I get goes like this:

var myCells = [
["MSFT","Microsoft Corporation", "#1329707339#02/19/12 20:08 PM"],
["ORCL", "Oracle Corporation", "#1329449106#02/16/12 20:25 PM"]
];

I need to fix the data in the date column by getting rid of the digits between the hashes.

"#1329449106#02/16/12 20:25 PM" should be just "02/16/12 20:25 PM"

I can't change it in the incoming data, so I need to correct it as the grid is displayed. Any suggestions? Is there a replace function that I can use? I tried the setCellFormat, but I'm probably not doing it correctly. Please help.
Friday, May 4, 2012
Nevermind ... found the response in the following thread:

http://www.activewidgets.com/javascript.forum.16593.9/suppress-repeat-data-to-improve.html

var myDataArray = [...];
function myDataFunction(c, r){return myDataArray[r][c].replace(..., ...)};
grid.setCellText(myDataFunction);

I feel like I'm on a treasure hunt for every solution in this forum. Nothing is easy to find.
Monday, May 7, 2012

This topic is archived.


Back to support forum

Forum search