Formatting Ajax data
Formatting Ajax data
I'm playing around with populating my datatables with AJAX data. Trying to an ajax source instead of converting dynamically rendered html. (IMO a loading icon over the table is better than a browser loading icon for impatient people)
I'm wondering if there is an easy way to interject the resulting value into html formatting instead of just the face-value:
For example I want every value in the 3rd column to be wrapped in a VALUE or I want the 4th column to be link
Does that make sense? And is the functionality there already? Alternatively, I'm working on just making the JSON pre-formatted. Can you comment on if there is any escaping that would mess that up?
I'm wondering if there is an easy way to interject the resulting value into html formatting instead of just the face-value:
For example I want every value in the 3rd column to be wrapped in a VALUE or I want the 4th column to be link
Does that make sense? And is the functionality there already? Alternatively, I'm working on just making the JSON pre-formatted. Can you comment on if there is any escaping that would mess that up?
This discussion has been closed.
Replies
There's also an example here: http://datatables.net/release-datatables/examples/advanced_init/column_render.html
Another question, will this affect the page rendering time more if we do it this way or if we were to do it server side before passing the json? Is this function affected by the "bDeferRender" option?
This morning I finished the formatting the json serverside. In my case it seems to be the same speed as the plain data. Either way, it's too slow for my liking.
Maybe when I get the json faster, i'll compare serverside vs clientside formatting speeds. I'm the only developer, so in this case I'm not concerned about who can access what formatting where (i.e. frontend vs backend developers)
Thanks again!