10-15-2019, 08:53 AM
I create my HTML table (datatables.net) include IWLabel raw text
<table id="mytable" class="table table-hover table-striped table-condensed dt-responsive nowrap" width="100%" cellspacing="0">
...
</table>
I have in my HTML template {%mytable%} and this style:
<style>
.sunday {
background-color: red !important;
}
</style>
After view IWLabel send (color row with red which are sunday):
WebApplication.CallBackResponse.AddJavaScriptToExecute
('$(document).ready( function () {'
+ 'var table = $("#mytable").DataTable({'
+ '"createdRow": function(row, data, dataIndex)'
+ '{ if (data[2] == "sun") {$(row).addClass("sunday");} }'
+ '});'
+ '}) ');
After AddJavaScriptToExecute get it:
DataTables warning: Non-table node initialisation (SPAN). For more information about this error, please see http://datatables.net/tn/2
<table id="mytable" class="table table-hover table-striped table-condensed dt-responsive nowrap" width="100%" cellspacing="0">
...
</table>
I have in my HTML template {%mytable%} and this style:
<style>
.sunday {
background-color: red !important;
}
</style>
After view IWLabel send (color row with red which are sunday):
WebApplication.CallBackResponse.AddJavaScriptToExecute
('$(document).ready( function () {'
+ 'var table = $("#mytable").DataTable({'
+ '"createdRow": function(row, data, dataIndex)'
+ '{ if (data[2] == "sun") {$(row).addClass("sunday");} }'
+ '});'
+ '}) ');
After AddJavaScriptToExecute get it:
DataTables warning: Non-table node initialisation (SPAN). For more information about this error, please see http://datatables.net/tn/2