brumble
16 Apr 2007, 3:00 AM
I am currently doing a custom row render using ext 1.0. I actually have the codes done up in before alpha release in the following:
var renderRow = function(dataModel, row, rowIndex, colCount, renderers, dindexes){
switch (dataModel.getValueAt(rowIndex, 2)){
case 1:
YAHOO.util.Dom.setStyle(row, 'display', 'none');
YAHOO.util.Dom.addClass(row, 'thread');
break;
case 0:
if (dataModel.getValueAt(rowIndex, 1) > 1)
YAHOO.util.Dom.addClass(row, 'thread');
break;
}
if (dataModel.getValueAt(rowIndex, 10) === 0)
YAHOO.util.Dom.addClass(row, 'unread');
if (dataModel.getValueAt(rowIndex, 11) === 0)
YAHOO.util.Dom.addClass(row, 'notmine');
YAHOO.ext.grid.GridView.prototype.renderRow.call(this, dataModel, row, rowIndex, colCount, renderers, dindexes);
};
the call that fire the above code:
grid.getView().renderRow = renderRow;
and the current codes that i've done for Ext1.0 :
var renderRows = function(i){
var rowIndex = this.rowIndex;
switch (ds.getAt(rowIndex).data.Thread){
case 1:
YAHOO.util.Dom.setStyle(i, 'display', 'none');
YAHOO.util.Dom.addClass(i, 'thread');
break;
case 0:
if (ds.getAt(rowIndex).data.Blank > 1)
YAHOO.util.Dom.addClass(i, 'thread');
break;
}
if (ds.getAt(rowIndex).data.Read === 0)
YAHOO.util.Dom.addClass(i, 'unread');
if (ds.getAt(rowIndex).data.Mine === 0)
YAHOO.util.Dom.addClass(i, 'notmine');
//Ext.grid.GridView.renderRows.call();
};
the call in Ext 1.0 now:
grid.getView().renderRows = renderRows;
Well, i am doing a check for every row that is going to be displayed on the grid, if a certain criteria is fulfilled, the row's style would be changed and class would be added. What i understand from the previous codes is that the dataModel is passed in and the row together with rowIndex could be retrieved.. now i'm unable to find a way to replicate a similar method in Ext 1.0. I'm sorry for the bad understanding of the whole Ext system. I hope someone could point out my bad or direct me to some example which i couldn't seems to be able to find or search from the forum. Thanks!
with regards!
var renderRow = function(dataModel, row, rowIndex, colCount, renderers, dindexes){
switch (dataModel.getValueAt(rowIndex, 2)){
case 1:
YAHOO.util.Dom.setStyle(row, 'display', 'none');
YAHOO.util.Dom.addClass(row, 'thread');
break;
case 0:
if (dataModel.getValueAt(rowIndex, 1) > 1)
YAHOO.util.Dom.addClass(row, 'thread');
break;
}
if (dataModel.getValueAt(rowIndex, 10) === 0)
YAHOO.util.Dom.addClass(row, 'unread');
if (dataModel.getValueAt(rowIndex, 11) === 0)
YAHOO.util.Dom.addClass(row, 'notmine');
YAHOO.ext.grid.GridView.prototype.renderRow.call(this, dataModel, row, rowIndex, colCount, renderers, dindexes);
};
the call that fire the above code:
grid.getView().renderRow = renderRow;
and the current codes that i've done for Ext1.0 :
var renderRows = function(i){
var rowIndex = this.rowIndex;
switch (ds.getAt(rowIndex).data.Thread){
case 1:
YAHOO.util.Dom.setStyle(i, 'display', 'none');
YAHOO.util.Dom.addClass(i, 'thread');
break;
case 0:
if (ds.getAt(rowIndex).data.Blank > 1)
YAHOO.util.Dom.addClass(i, 'thread');
break;
}
if (ds.getAt(rowIndex).data.Read === 0)
YAHOO.util.Dom.addClass(i, 'unread');
if (ds.getAt(rowIndex).data.Mine === 0)
YAHOO.util.Dom.addClass(i, 'notmine');
//Ext.grid.GridView.renderRows.call();
};
the call in Ext 1.0 now:
grid.getView().renderRows = renderRows;
Well, i am doing a check for every row that is going to be displayed on the grid, if a certain criteria is fulfilled, the row's style would be changed and class would be added. What i understand from the previous codes is that the dataModel is passed in and the row together with rowIndex could be retrieved.. now i'm unable to find a way to replicate a similar method in Ext 1.0. I'm sorry for the bad understanding of the whole Ext system. I hope someone could point out my bad or direct me to some example which i couldn't seems to be able to find or search from the forum. Thanks!
with regards!