I'm using PHP to render a serialized array to build my datatables and it's working great. However, I'd like to add a column at the end of the table called "Actions" and within each row, there would be a dropdown menu the user could select that would direct them to a specific URL (examples: edit item, duplicate item, remove item, etc.)
I know I could add a dummy field to my array to add the column itself, but not sure how I would format values to populate some sort of select menu to drop-down for the column values. Any advice? Thank you!
Imagine I have 3 columns populating the data coming from a data array:
Name | Company | State
I want to add a column at the end, like:
Name | Company | State | Actions
In that Actions column, I want to either have custom HTML, or a select form field that I can attach URLs to. Basically just adding a custom column at the end of the table. Thanks.
You can do this by choosing column type string and passing html with select option in it which will be populated with option that you want and need and it should work.
Hi--great plug-in!
I'm using PHP to render a serialized array to build my datatables and it's working great. However, I'd like to add a column at the end of the table called "Actions" and within each row, there would be a dropdown menu the user could select that would direct them to a specific URL (examples: edit item, duplicate item, remove item, etc.)
I know I could add a dummy field to my array to add the column itself, but not sure how I would format values to populate some sort of select menu to drop-down for the column values. Any advice? Thank you!
Hi davidpaulalbert,
Thank you for your purchase.
Sorry but I did not quite understand you what are you trying to achieve can you please describe me more.
Thank you.
Kind Regards,
Miloš Jovanović
[email protected]
Rate my support
Try our FREE mapping plugin! MapSVG - easy Google maps, interactive SVG maps and floor plans, choropleth maps and much more - https://wordpress.org/plugins/mapsvg-lite-interactive-vector-maps/
wpDataTables: FAQ | Facebook | Twitter | Instagram | Front-end and back-end demo | Docs
Amelia: FAQ | Facebook | Twitter | Instagram | Amelia demo sites | Docs | Discord Community
You can try wpDataTables add-ons before purchasing on these sandbox sites:
Powerful Filters | Gravity Forms Integration for wpDataTables | Formidable Forms Integration for wpDataTables | Master-Detail Tables
Sorry that I wasn't clear.
Imagine I have 3 columns populating the data coming from a data array:
Name | Company | State
I want to add a column at the end, like:
Name | Company | State | Actions
In that Actions column, I want to either have custom HTML, or a select form field that I can attach URLs to. Basically just adding a custom column at the end of the table. Thanks.
Hi davidpaulalbert
You can do this by choosing column type string and passing html with select option in it which will be populated with option that you want and need and it should work.
This is an example of it
You can find more on this link.
Hope this can help.
Kind Regards,
Miloš Jovanović
[email protected]
Rate my support
Try our FREE mapping plugin! MapSVG - easy Google maps, interactive SVG maps and floor plans, choropleth maps and much more - https://wordpress.org/plugins/mapsvg-lite-interactive-vector-maps/
wpDataTables: FAQ | Facebook | Twitter | Instagram | Front-end and back-end demo | Docs
Amelia: FAQ | Facebook | Twitter | Instagram | Amelia demo sites | Docs | Discord Community
You can try wpDataTables add-ons before purchasing on these sandbox sites:
Powerful Filters | Gravity Forms Integration for wpDataTables | Formidable Forms Integration for wpDataTables | Master-Detail Tables