Hello,
I am trying to set up a timer that will flash certain index rows in UltraWebGrid component.
Unfortunately, once that I have my row object in javascript I cannot change any style... it seems like my changes are hidden or encapsulated by a major style somehow.
I have tried to change the FontFamily and backgroundColor using row.Element.style.XXXXX = YYYY; , but this does not seems to work.
Please, how I can I change a row/cell style in client using javascript?
Thank you very much for the support!
Regards,
Hi,
The row.Element is accessible in JavaScript. I used both the cellId and the rowId to get the Row object. Here is my code snippet:
{
row.Element.style.backgroundColor = "Red";
}
function UltraWebGrid1_CellClickHandler(gridName, cellId, button)
row.Element.style.backgroundColor = "Brown";
row.Element.style.color = "Blue";
In the AfterRowActivateEvent Handler, the rowId is a parameter while in CellClickHandler the cellId is a parameter. Both of them work.
I hope this helps.
Thanks
Can I assume this doesn't work if you use the LoadLayout feature of the data grid? I've tried the exact syntax above, also row.Element.className = 'highlightRow' (where highlightRow is a class in the style sheet). It doesn't seem to work. I've used the "alert" feature of javascript to make sure my row is an object, and that the className property was set. Both appear to be correct, but nothing happened to the grid row. Any other suggestions or ideas? Thanks!
Never mind, it appears that the "row" never gets the pre-defined classes when using the xml preloaded layout. Instead the grid seems to set the "RowDefaultStyle' at the cell level which overrides my attempt to set a row level style. Is there a reason for this?
Found this out by doing a javascript alert on the cell.Element.className vs the row.Element.className. The cell had all kinds of classnames, but the row className property was completely empty.