http://docs.webix.com/datatable__styling.html#cells,
can i do this operation onAfterLoad/onBeforeLoad
? what i am trying to do is like this - http://webix.com/snippet/977bfa6b
http://docs.webix.com/datatable__styling.html#cells,
can i do this operation onAfterLoad/onBeforeLoad
? what i am trying to do is like this - http://webix.com/snippet/977bfa6b
You can use addRowCss and addCellCss from onAfterLoad event
Also, you can use any of techniques in linked article, after data loading, and call dtable.refresh() to apply changes to the datatable.
in my case dtable.refresh()
and/or dtable.refreshColumns()
will reassign the default property.
example:
dtable.addCellCss(cur.row, cur.column, “webix_cell_select”);
$(".webix_cell_select").css(“border-color”, configData.editedCell);
$(".webix_cell_select").css(“background-color”, “#3498DB” );
(configData.editedCell - the property assigned from backend)
after doing this, dtable gets refreshed again and its default property will be assigned back. What should i do!
It is expected, when you assigning custom styles through custom code it will not be preserved after component’s repaint.
Why do not add the necessary styling through addCellCss instead of using a such complex solution as in above snippet ?
addCellCss requires a class where in style properties are defined but in my case the background-color and border-color are sent as a json from server based on which styling has to be done on edited cell.
dtable.addCellCss(cur.row, cur.column,
webix.html.createCss({ "background-color" : "#3498DB" })
);