Jump to content

Mobile DBListGrid config.itemTpl Table Row Color Function


andyhill

Recommended Posts

I have A Complex Table (minimised here for simplicity), Please advise how I can set each row color in the itemTpl based on a DBListGrid Data Value.

ListGrid.ClientEvents.UniEvents.Add('beforeInit=function beforeInit(sender, config)'+

'{'+

'config.itemTpl='+
'<table style="width:100%; white-space: nowrap; vertical-align:middle;">'+
'  <tr bgcolor={[this.getColour(values)]}'+
'    <td "Test Data"/td>'+
'  </tr>'+
'</table>,'+
' {'+
'    getColour: function(values)'+
'    {'+
'      if(values[1] == true) return "#FF00FF";'+
'      else return "#00FF00";'+
'    }'+
'  };'+

'<img onclick="javascript:xxxxx"/>'+

'}'

);

Link to comment
Share on other sites

  • 1 month later...
×
×
  • Create New...