datatables sorting with images

datatables sorting with images

MaddyMaddy Posts: 24Questions: 0Answers: 0
edited August 2012 in General
I have the following problem - I have a datatable with n number of rows. The first column is Serial Number using simple counter. My table has a functionality in which when I double click the row, it becomes editable and 'check' and 'cancel' images show up in the first column, right beside the serial number. User can edit row and save/cancel the row accordingly. The problem with this logic is, since there are images in the first column, I'm not able to sort the table based on the first column. When I remove the images, sorting works perfectly.

I know this is a weird problem, but I really dont want to change the editing logic for this.

Please help!

Replies

  • RobMRobM Posts: 5Questions: 0Answers: 0
    What if you used jQuery/JavaScript to dynamically insert the images once the editing function has been called:
    1. User triggers the edit
    2. JavaScript inserts the cancel and check images
    3. JavaScript binds these images to their functions
    4. user interacts with the edit until finished
    5. once finished, JavaScript destroys the images and the binding
  • MaddyMaddy Posts: 24Questions: 0Answers: 0
    Yup, I exactly did what you said and is now working wonderfully. I used jQuery to 'append and remove' the elements. Thanks a lot!!
This discussion has been closed.