Fetch data in a selected table row |
The problem is in this line of your script:
Code: $('#ppmpsupplies').on('click', 'tr', edit_item( <?php echo $item->id ?> )); If you echo a php value in a script section of your page, it is done when the page is outputted by php. This happens only once, so the value of $item->id is the last $item->id php recognizes. It's better to add a data-id property to each table row (or the button that will trigger AJAX). Once you start your AJAX action, you can refer to the data-id property of the selected row. (06-26-2017, 11:28 PM)Wouter60 Wrote: The problem is in this line of your script:Yes sir, That's the code above given by paradinight. The problem now is the error I mentioned above. When I try to switch the parameters (id, element) the functionality of delete works but still the error undefined appears. Thanks for the time.
Code: callback: function(item, id) { |
Welcome Guest, Not a member yet? Register Sign In |