Does Serverside DataTables work with non-text data cells?

Does Serverside DataTables work with non-text data cells?

AegisAegis Posts: 1Questions: 0Answers: 0
edited February 2015 in Free community support

Hello,

Our team is currently developing an application that provides a table that is editable Excel-style through text input fields and select drop-down lists on data (td) cells. From the examples provided on this site and previous implementation experience on simpler tables, I don't know if server side handling is possible for this type of table. I am unsure of how to handle the JSON data returned from the server, any help would be appreciated.

We are using MVC 5 and jQuery to handle dataTables.

Thanks in advance!

Replies

  • ignignoktignignokt Posts: 146Questions: 4Answers: 39
    edited February 2015

    You could just return a block of HTML from the server-side code. Say your return is {"data":[{"select":"Frank"}]} you can instead return

    {"data":[{"select":"<select> <option value='1' selected>Frank</option> <option value='2'>Tom</option> </select>"}]}
    

    You would of course need to modify the ssp.class.php example to fit your needs. I use select drop downs and a lot of other HTML in my various datatable calls and it works fine.

This discussion has been closed.