Dynamically Display ColumName

Dynamically Display ColumName

ramkrishnaramkrishna Posts: 4Questions: 0Answers: 0
edited June 2012 in DataTables 1.8
i want to load column names from the server, using DataTables or is there any other way to get it done ...do give me some code to display colunName and Data........I got stuck from 2 week now to do this

Replies

  • ramkrishnaramkrishna Posts: 4Questions: 0Answers: 0
    @allan help me out
  • jamovjamov Posts: 5Questions: 0Answers: 0
    edited July 2012
    I do it like this:
    In my ready function
    [code]
    var tableSource = ;
    $("#htmltable").load(tableSource, function(){ };
    [/code]

    in body of document,
    I put this where I want the table displayed
    [code][/code]

    then i have a servlet referenced by
    that returns something like this:
    [code]



    Due Date
    Item #
    Order Qty



    Loading data from server


    [/code]

    Which my servlet could replace the headers, or in my case, the url changes so I hit different servlets for different headers and data.
    I load the data via another url (or more precisely using the same url but with different parameters for output I want)
    I suppose you could put the data in that table at the same time, but I prefer to setup the datatable to load its data dynamically more often via a json array, without necessarily hitting the server for the headers each time.
This discussion has been closed.