You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Have a data table which has some numeric columns. I am not able to get those columns to either be right justified or take num-fmt or even to add some text through a render fn. I am not a datatables/javascript expert so could be doing something basic wrong.
All help appreciated!
Here are my three different attempts
Trying to right justify the col - all other cols appear in table but this col shows undefined
tb = DataTable("pltable", "/pltable/", latestPL, columns=cols, paging=True, searching=True, sortable=True, pageLength=40,
columnDefs=[{
"className": "dt-body-right",
"targets": [0]
}])
This should work! Inspecting the option in React/Javascript debugger shows as if the definition is ok
Trying to add fmt - all other cols appear in table but this col shows undefined
tb = DataTable("pltable", "/pltable/", latestPL, columns=cols, paging=True, searching=True, sortable=True, pageLength=40,
columnDefs=[{
"type": "html",
"targets": [0]
}])
This should work! Inspecting the option in React/Javascript debugger shows as if the definition is ok
Trying to just add "(abc)" to value of each row in col 0 (as a test)
tb = DataTable("pltable", "/pltable/", latestPL, columns=cols, paging=True, searching=True, sortable=True, pageLength=40,
columnDefs=[{
"render": function ( data, type, row ) {
return data +' ('+ 'abc' +')';
},
"targets": 0
}])
This does not compile. If I surround function with """ then it emits the func as a character string in the react structure.
The text was updated successfully, but these errors were encountered:
Have a data table which has some numeric columns. I am not able to get those columns to either be right justified or take num-fmt or even to add some text through a render fn. I am not a datatables/javascript expert so could be doing something basic wrong.
All help appreciated!
Here are my three different attempts
tb = DataTable("pltable", "/pltable/", latestPL, columns=cols, paging=True, searching=True, sortable=True, pageLength=40,
columnDefs=[{
"className": "dt-body-right",
"targets": [0]
}])
This should work! Inspecting the option in React/Javascript debugger shows as if the definition is ok
Trying to add fmt - all other cols appear in table but this col shows undefined
tb = DataTable("pltable", "/pltable/", latestPL, columns=cols, paging=True, searching=True, sortable=True, pageLength=40,
columnDefs=[{
"type": "html",
"targets": [0]
}])
This should work! Inspecting the option in React/Javascript debugger shows as if the definition is ok
Trying to just add "(abc)" to value of each row in col 0 (as a test)
tb = DataTable("pltable", "/pltable/", latestPL, columns=cols, paging=True, searching=True, sortable=True, pageLength=40,
columnDefs=[{
"render": function ( data, type, row ) {
return data +' ('+ 'abc' +')';
},
"targets": 0
}])
This does not compile. If I surround function with """ then it emits the func as a character string in the react structure.
The text was updated successfully, but these errors were encountered: