Is it possible to use string header from datatable ajax query like export header.

Is it possible to use string header from datatable ajax query like export header.

msm_baltazarmsm_baltazar Posts: 59Questions: 22Answers: 0

Hello, I am using datatable in my ASP.NET MVC project. I initialize the datatable in the document.ready function. The datatable receives a json object from the action on the server with an ajax post request. This object contains one list and the other string data. Because I am returning hashset from the action. The table rows are formed by returning the list in the dataSrc of the datatable. There is no problem until here. But the datatable's own export I am using the buttons (excel, pdf) option. I want to dynamically assign the string part of the object returned from the server as export title. So in the ajax call, both the list by filling the table and the export title of this list are returned. My question is, how can I export the dynamic string title? Or can I use the string from this server as an export header in initcomplete. Thinking that the question is clear, I didn't create a test case. Thanks in advance.

This question has an accepted answers - jump to answer

Answers

  • kthorngrenkthorngren Posts: 20,275Questions: 26Answers: 4,765
    Answer ✓

    You can use initComplete to get the string from the returned JSON and store it in a global variable. This example shows how to use a function with messageTop. Is this what you are looking for?

    Kevin

  • msm_baltazarmsm_baltazar Posts: 59Questions: 22Answers: 0

    Thank you very very much my brother:)

Sign In or Register to comment.