Add lighbox to button
Add lighbox to button
Hello,
I managed to add my own aButton to open a url. What i want is that this url opens in a lightbox like the standard edit or new buttons.
My code looks now like:
TableTools.BUTTONS.gotoURL = {
"sAction": "text",
"sFieldBoundary": "",
"sFieldSeperator": "\t",
"sNewLine": "<br>",
"sToolTip": "",
"sButtonClass": "",
"sButtonClassHover": "",
"sButtonText": "Go to URL", // default, change when initiating
"sGoToURL": "", // default, change when initiating
"mColumns": "all",
"bHeader": true,
"bFooter": true,
"fnMouseover": null,
"fnMouseout": null,
"fnClick": function( nButton, oConfig ) {
location.href = oConfig.sGoToURL;
},
"fnSelect": null,
"fnComplete": null,
"fnInit": null
};
aButtons: [
{
"sExtends": "gotoURL",
"sButtonText": "Add",
"sDiv": "gotoURL",
"sGoToURL": "add.php",
},
Hope someone can help me out!
Thanks!
Olan
This discussion has been closed.
Replies
The Editor lightbox is opened by triggering
create()
oredit()
as appropriate in thefnClick
.The Editor lightbox is not reusable outside of Editor at the moment, so you would need to either create a new lightbox or use a library for it, and then open it in the
fnClick
(where you are currently redirecting the page).Allan
Thank you Allen. I wil look for another way to do it.