Column sorting with data.sort attribute

Column sorting with data.sort attribute

viandanteviandante Posts: 22Questions: 10Answers: 1

Hi to all,

when i change a value of a cell that in the DT creations is in the form:

data: { _:data.display, sort: data.timestamp}

How can i change the sort attribute when i update the _ attribute?

Thanks

Massimo

Answers

  • allanallan Posts: 61,044Questions: 1Answers: 9,955 Site admin

    How are you updating the cell? I would suggest using:

    table.cell( ... ).data( {
      display: '...',
      "@data-sort": '...'
    } );
    

    Or if you have updated the HTML use cell().invalidate().

    Allan

  • viandanteviandante Posts: 22Questions: 10Answers: 1
    edited October 2014

    I change the value with the x-editable plugin.

    The match of the elements to x-editable is in the drawCallback, but can i retrieve the table cell from here?

    Thanks

    Massimo

  • allanallan Posts: 61,044Questions: 1Answers: 9,955 Site admin

    I've not used x-editable myself - I'm not sure how it would be done. I suspect the best way would be to write to the HTML and then invalidate the cell.

    Allan

  • viandanteviandante Posts: 22Questions: 10Answers: 1

    The only solution that i have found is the redraw of the table at every edit...

    Thanks!

This discussion has been closed.