Quantcast
Channel: Free community support — DataTables forums
Viewing all articles
Browse latest Browse all 35608

How can I load table column headings and data from server using ajax ?

$
0
0

Hi There,

I have a requirement where a user has an option to select a set of columns (say 3 columns out of 10 available columns) and when click of a button, the table should load data for those selected 3 columns and their table column headings from the the server, using Ajax. I'm using columnDef for this and having json as below -

{"aaData":[],"aoColumnDefs":[{"aTargets":"0","mDataProp":"projectName","sTitle":"Project Name","bVisible":true,"bSearchable":true},{"aTargets":"1","mDataProp":"projectStatus","sTitle":"Project Status","bVisible":true,"bSearchable":true}],"data":[{"projectName":"Test Project 3","projectStatus":"No Status","projectUrl":null,"projectId":"4"},{"projectName":"Test Project 12","projectStatus":"On Track","projectUrl":null,"projectId":"8"},{"projectName":"Test Project 5","projectStatus":"Minor Impact","projectUrl":null,"projectId":"7"},{"projectName":"Test Project 1","projectStatus":null,"projectUrl":null,"projectId":"2"},{"projectName":"Test Project 4","projectStatus":"Minor Impact","ccDate":null,"projectUrl":null,"projectId":"5"},{"projectName":"Test Project 2","projectStatus":"No Status","projectUrl":null,"projectId":"3"}]}

I'm trying with some options here but I couldn't succeed. Have anyone tried it before or Is this possible to load the column headings from the server over ajax ?

Many thanks for your time and help here. Any sample code will be much appreciated.

Thanks


Viewing all articles
Browse latest Browse all 35608

Trending Articles