Set name to column from ajax and send to ajax on sort
Set name to column from ajax and send to ajax on sort
Hi,
i have a dynamic datatable with dynamic headers, for example, i select my table headers from the database( headers = ).
now, im trying to sort this headers with ajax request. im getting the 'iSortCol_0' to my server-side script with the position number of the header.
i want to set a name for the header so i could recognize him on my server-side script.
i tried to set "sTitle" but unfortunately it does not send me the sTitle of the particular column that being sorted.
here is my JSON:
[code]
aaData:[..........]
aoColumns: [{sTitle:CheckBox}, {sTitle:FullName}, {sTitle:Email}, {sTitle:Phone},…]
0: {sTitle:CheckBox}
1: {sTitle:FullName}
2: {sTitle:Email}
3: {sTitle:Phone}
4: {sTitle:56DDC6E0-6BA2-25DF-8FC5-2FA0D3110D72}
5: {sTitle:09BC4917-867A-E916-890F-1D249E863C14}
6: {sTitle:Created}
7: {sTitle:Edit}
8: {sTitle:Delete}
iTotalDisplayRecords: 3
iTotalRecords: 3
sEcho: 1
[/code]
any ideas??
thank you!!!!
i have a dynamic datatable with dynamic headers, for example, i select my table headers from the database( headers = ).
now, im trying to sort this headers with ajax request. im getting the 'iSortCol_0' to my server-side script with the position number of the header.
i want to set a name for the header so i could recognize him on my server-side script.
i tried to set "sTitle" but unfortunately it does not send me the sTitle of the particular column that being sorted.
here is my JSON:
[code]
aaData:[..........]
aoColumns: [{sTitle:CheckBox}, {sTitle:FullName}, {sTitle:Email}, {sTitle:Phone},…]
0: {sTitle:CheckBox}
1: {sTitle:FullName}
2: {sTitle:Email}
3: {sTitle:Phone}
4: {sTitle:56DDC6E0-6BA2-25DF-8FC5-2FA0D3110D72}
5: {sTitle:09BC4917-867A-E916-890F-1D249E863C14}
6: {sTitle:Created}
7: {sTitle:Edit}
8: {sTitle:Delete}
iTotalDisplayRecords: 3
iTotalRecords: 3
sEcho: 1
[/code]
any ideas??
thank you!!!!
This discussion has been closed.
Replies
If you want to get the column information from an Ajax source, you need to make the Ajax call, construct the table and then initialise DataTables.
There should be nothing in the documentation suggesting that what you have tried is possible, and if there is, it would be great if yo could let me know where so I can remove it.
Allan