Is it possible to add metadata to ajax loaded data?
Is it possible to add metadata to ajax loaded data?
Hi,
one thing that I do not know how to resolve by some better means, is that I cannot add some metadata to the every cell of aaData got from fnReloadAjax call.
1) Some cells need to be colorized and decision (rule if it has to be colorized and color) is made by the server. So what I'm doing is that I sent data in aaData of every cell in the form color|celldata and I parse it in mRender function. But this is very awkward..
2) Also I want to add dropdown menu in every row. Links in this menu have to be generated somehow, so I will send urls in aaData and parse it.
Is there some other way how to do it? It would be nice to have possibility to set maybe some data attribute to every cell/row in aaData. I assume that sending markup in aaData is not recommended or supported.
EDIT: some nested json?
Thanks for any hint
one thing that I do not know how to resolve by some better means, is that I cannot add some metadata to the every cell of aaData got from fnReloadAjax call.
1) Some cells need to be colorized and decision (rule if it has to be colorized and color) is made by the server. So what I'm doing is that I sent data in aaData of every cell in the form color|celldata and I parse it in mRender function. But this is very awkward..
2) Also I want to add dropdown menu in every row. Links in this menu have to be generated somehow, so I will send urls in aaData and parse it.
Is there some other way how to do it? It would be nice to have possibility to set maybe some data attribute to every cell/row in aaData. I assume that sending markup in aaData is not recommended or supported.
EDIT: some nested json?
Thanks for any hint
This discussion has been closed.
Replies
Allan
EDIT: Sorting does not work as well.
Thank you for any hint.
[code]
"fnCreatedCell": function(nTD,sData,oData,iRow,iCol) {
if (sData.color != "") {
var color = sData.color
$(nTD).css('background-color', color);
}
$(nTD).html (sData.value)
}
[/code]
Allan
Allan
Allan