Add button column
Add button column
Allen,
I would like to add aq button in a column next to data from ajax. how can I accomplcih this. current code is.
code:
$('#projScopeTabl').DataTable( {
responsive: true,
ajax: {
url: 'phpScripts/getProjScopeTableData.php',
dataSrc: ''
},
columns: [
{ data: 'proj_name' },
{ data: 'proj_client_name' },
{ data: 'proj_city' },
{ data: 'proj_state_abr' },
{ data: 'proj_status' },
{ data: 'proj_units' },
{ data: 'proj_sqft'}
//would like to add repeating button here
]
});
html:
Project Name | Client Name | City | State | Status | Units | Sqft |
---|
This discussion has been closed.
Replies
html:
You may also have to modify the HTML before you create the DataTable by inserting the extra column into the HTML table (assuming that it is already there):
Allan
Thank you so much
In the above code I have added a modal to pop up upon click. It should populate with the current JSON objects data, but only shows the first JSON oblect data. How can I fix this mate?
It sounds like it might be a closure issue. Can you give me a link to the page showing the issue so I can help to debug it please?
Allan
Mate I have sent you a private message with access to my server and the need files. Should be ready in about an hour.
The modal starts on line 185 of projects_table html.
This is actually what I want with the ajax data, but have no clue whats going on or how to add it
https://datatables.net/extensions/responsive/examples/display-types/bootstrap4-modal
www.mitoinsulation.online. I have added it to the web for your view
Got it - thanks for that!
The problem is that you have invalid HTML. Specifically there are multiple
div
element which have the sameid
attribute. You'd need a unique id for each one, or to have a single modal outside of the table which is updated based on the content of the row (which is probably how I would suggest you do it) and then trigger that single modal to show.Allan