How to prepend ?

How to prepend ?

princyprincy Posts: 12Questions: 1Answers: 0

Link to test case: http://live.datatables.net/naqomuxe/1/edit
Debugger code (debug.datatables.net):
Error messages shown:
Description of problem: the column 1 sort to a division with class "abc" .

Answers

  • allanallan Posts: 54,680Questions: 1Answers: 8,552 Site admin

    I'm afraid I don't understand your question - do you want to add the class abc to the cells in the first column? If so, use columns.className.

    Allan

  • princyprincy Posts: 12Questions: 1Answers: 0

    Hi,

          without knowing the id or class name may unable to detach and prepend or append an element ?
    

    As per your answer and from https://datatables.net/reference/option/columns.className

    update the query at http://live.datatables.net/naqomuxe/2/edit

    Now the entire column 1 moved to division with class .abc

    My requirement is only move the column 1 header with sort function to div with class abc.

    Hope you may clear now ?

  • colincolin Posts: 12,600Questions: 0Answers: 2,154

    No, still a bit muddled :) Are you saying you want to move the header for column 1 into another element? That would be odd for the table to have one column without a header!

    Colin

  • princyprincy Posts: 12Questions: 1Answers: 0

    Hi,

        Is that possible like so ?
    
  • allanallan Posts: 54,680Questions: 1Answers: 8,552 Site admin

    You can trigger sorting on a column using the column().order() method, but you can't remove the header from a column. As Colin says, that would be a bit odd and I don't know what the use case for that would be?

    Allan

  • princyprincy Posts: 12Questions: 1Answers: 0

    Hi,

        okay.
    
                      Anyhow is it possible to move the entire header to a custom division using append or prepend ?
    
Sign In or Register to comment.