Add lighbox to button

Add lighbox to button

OlanOlan Posts: 41Questions: 11Answers: 1
edited September 2014 in Editor

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

Replies

  • allanallan Posts: 61,744Questions: 1Answers: 10,111 Site admin

    The Editor lightbox is opened by triggering create() or edit() as appropriate in the fnClick.

    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

  • OlanOlan Posts: 41Questions: 11Answers: 1

    Thank you Allen. I wil look for another way to do it.

This discussion has been closed.