0

In my app, I used jQuery Data Table to show the results of a query made by form. I have now a new task: I must add, in this table, a column where for each row I have a button (or a link, no matter which of this 2).

The focal point is that when a user click this button or link, a popup must be open to allow the operator to modify some value in the db (so it's for this that I need a button for each row; every row may have a value to modify, or not).

The question is: how can I add this button/link and how can I force, after click, the popup opening?

Talha Awan
  • 4,573
  • 4
  • 25
  • 40
Luca Sepe
  • 733
  • 4
  • 19
  • 30

2 Answers2

0

You can do this like:

$('#data_table').DataTable( {
  data: data
});

$(document).on('click', '#data_table tbody tr', function(){
  // alert('hello');
  $('#dialog').dialog();
});

Working Fiddle

Note: In this example I am using jquery ui dialog, you can use Bootstrap modal as well

Mayank Pandeyz
  • 25,704
  • 4
  • 40
  • 59
-1

Use bootstrap Modal. Bootstrap modal will allow you to do the operation you want

Pratik Patil
  • 11
  • 1
  • 4