alfajango / jquery-dynatable

A more-fun, semantic, alternative to datatables
http://www.dynatable.com
Other
2.77k stars 363 forks source link

Column button #233

Open Fabryprog opened 8 years ago

Fabryprog commented 8 years ago

hello,

i want to put a button in a fixed column to every row.

How to do it?

robinzetterstrom commented 8 years ago

Hi Fabryprog

I see that you posted this issue on 5th of Jan but regardless, someone might find this useful. My way of solving that is by doing like this.

$.getJSON( "products.json", function( data ) {
      $.each( data, function( key, val ) {
        $("#products tbody").append("<tr><td>" + data[key].id + "</td><td>" + data[key].name + "</td><td><a class='btn btn-primary' href='product.php?show=" + data[key].id + "'>Edit</a></td></tr>");
      });
      $('#products').dynatable(...........);
  });

It's probably not the most efficient way of doing it but it works.