:: Forum >> Version 2 >>

Call Back during Data Loading?

What I want to do and hopefully there is a way to do this is that I would like to hook into a call back after a row from my CSV is loaded so that I could then do some dynamic formating (Want to highlight a row if a particular value is set). Is there a way to accomplish this? What I am trying to avoid is having to place HTML formating code into my CSV that is being returned.

I am using

var table = new AW.CSV.Table;

and

var obj = new AW.Grid.Extended;
WeeJavaDude
Tuesday, April 18, 2006
You can assign a function into the row background style (or css class) and this function will return the color dynamically based on the row data -

var obj = new AW.UI.Grid;
    
obj.setCellData(function(colrow){return col "." row});
    
obj.setHeaderText(function(i){return "Col " i});
    
obj.setColumnCount(20);
    
obj.setRowCount(100);

    
// create new row property
    
obj.defineRowProperty("color", function(row){
        return 
this.getCellData(0row).match("1""red" "white";
    })

    
// link row background to row color property
    
obj.getRowTemplate().setStyle("background", function(){
        return 
this.getRowProperty("color");
    });

    
document.write(obj);
 
Should work with CSV source without any changes.
Alex (ActiveWidgets)
Tuesday, April 18, 2006



This topic is archived.

Back to support forum

Forum search