Displaying a field twice (or more) in a different manner
Displaying a field twice (or more) in a different manner
ericpanorel
Posts: 7Questions: 0Answers: 0
I have a list of objects, returned via json. The object (for simplicity sake) looks like:
[code]{ SalesOrder: 12345, Amount: 100}[/code]
Now I want to display it in such a way that the first column is a clickable button. So I used the fnRender trick:
[code]
{ "sName": "SalesOrderNumber",
"aTargets": [0],
"mDataProp": "SalesOrderNumber",
"bSearchable": false,
"bSortable": false,
"fnRender": function (oObj) {
var id = oObj.aData["SalesOrderNumber"];
var s = '';
s += '';
s += '';
return s;
} // fnRender
}, // SalesOrderNumber
[/code]
And the second column, will display the plain text value:
[code]
{ "sName": "SalesOrderNumber", "aTargets": [1], "mDataProp": "SalesOrderNumber" },
[/code]
However, this didn't work because the second column also displays in the same manner as the first column. Any ideas?
Thanks....
[code]{ SalesOrder: 12345, Amount: 100}[/code]
Now I want to display it in such a way that the first column is a clickable button. So I used the fnRender trick:
[code]
{ "sName": "SalesOrderNumber",
"aTargets": [0],
"mDataProp": "SalesOrderNumber",
"bSearchable": false,
"bSortable": false,
"fnRender": function (oObj) {
var id = oObj.aData["SalesOrderNumber"];
var s = '';
s += '';
s += '';
return s;
} // fnRender
}, // SalesOrderNumber
[/code]
And the second column, will display the plain text value:
[code]
{ "sName": "SalesOrderNumber", "aTargets": [1], "mDataProp": "SalesOrderNumber" },
[/code]
However, this didn't work because the second column also displays in the same manner as the first column. Any ideas?
Thanks....
This discussion has been closed.
Replies
For more advanced options, take a look at this post: http://datatables.net/blog/Orthogonal_data
Allan