Is there a way to render an ASP MVC view as a return of a AjaxSource?
Is there a way to render an ASP MVC view as a return of a AjaxSource?
theConartist
Posts: 14Questions: 3Answers: 0
Is there a substitute that instead of rendering the json data in javascript, a new attribute in DataTablesData that contains a rendered html View? also, a DataTable class that handles the rendering?
And on the redraw of the table, renders the returned view?
I know I could use an Ajax call to render the table and call the .dataTable after but I do not know how to embed the dataTableParams capabilities this way.
This discussion has been closed.
Answers
Assuming that it is returning HTML, then not built into the core. You would need to use
ajax.dataSrc
as a function and parse the HTML to built a Javascript array from the HTML.Allan
What I did was:
where the json returned is the DataTablesData and I added an attribute view that contains the html.
Now this error occurs "DataTables warning: Requested Unknown parameter '0' from the data source for row 0"
What is the value of
json
that you are giving tofnCallback
?Allan
And what is the value of
aaData
? What is the result of the statement. It would be really useful if you could link to the page.edited - wrong post