jquery - How to add button at the end of each column in datatable in MVC 4? -
i new concept. want add button @ end of each column in datatable.
i can in asp.net, not have idea in mvc 4.
please advise me on issue.
code below:
<table class="plans-table"> <thead> <tr> @foreach (datacolumn col in table.columns) { <th>(@col.columnname)</th> } </tr> </thead> <tbody> @foreach (datarow row in table.rows) { <tr class="plans-row"> @foreach (datacolumn col in table.columns) { <td> @row[col.columnname] </td> } </tr> } </tbody> </table>
you can add button @ end of each row, like:
<table class="plans-table"> <thead> <tr> @foreach (datacolumn col in table.columns) { <th>(@col.columnname)</th> } <th>options</th> </tr> </thead> <tbody> @foreach (datarow row in table.rows) { <tr class="plans-row"> @foreach (datacolumn col in table.columns) { <td> @row[col.columnname] </td> } <td><input type="button" value="click me!" name="rowbutton"/></td> </tr> } </tbody> </table>
as mvc differs asp.net
in structure, note normal html button. such, need use javascript perform postbacks or other operations.
Comments
Post a Comment