Is there an example of a dropdown list in a column of every row based on a value in another column?

Is there an example of a dropdown list in a column of every row based on a value in another column?

lrobinsonjrlrobinsonjr Posts: 2Questions: 2Answers: 0

Ideally, I'm looking to pass one or more values to a render function using onclick event for accessing data via a controller action. I'm using Ajax and JQuery to retrieve datatable data. Should I populate another datatable to retrieve the dropdown list values? Also, is it possible to pass multiple parameters using the function (data) syntax? Thanks in advance.

Answers

  • kthorngrenkthorngren Posts: 21,343Questions: 26Answers: 4,954

    Are you asking about the columns.render function? There are no restrictions for this function with regard to the data nor what you render into the table cells. I'm not clear exactly what you want to do but you should be able to render the HTML needed. However you will want to be aware of how to handle events with Datatables. See this FAQ.

    If you still have questions please provide more specifics of what you are trying to do. A test case will go along way for use to be able to help.
    https://datatables.net/manual/tech-notes/#Technical-notes

    Kevin

This discussion has been closed.