returning json, using mDataProp, and adding a span wrapping a value
returning json, using mDataProp, and adding a span wrapping a value
mg
Posts: 47Questions: 0Answers: 0
If I wanted to wrap the value in a table cell with a , giving some value,
then using DataTables 1.9.2, is there an example of the best way
to go about doing this when returning json in fnServerData and using mDataProp?
then using DataTables 1.9.2, is there an example of the best way
to go about doing this when returning json in fnServerData and using mDataProp?
This discussion has been closed.
Replies
1. Get the server to return the data with the span tags always in place
2. Use fnRender to add the span tags - *edit* Use mRender now - fnRender is deprecated.
3. Use mDataProp as a function to add the span tags - http://datatables.net/blog/Orthogonal_data
DataTables 1.9.3 will add yet another option - mRender - much like mDataProp but a little easier to use.
Allan
solution i found using mRender to wrap the text with a div style eg cell text here:
[code]
"aoColumnDefs": [
{
"aTargets": [ 0 ],
"mData": "0",
"mRender": function ( data, type, full ) {
return ''+data+'';
}
}
],
[/code]
Allan