Appframe Knowledge Base


1 hits
0

Using af.controls.Dialog - Create via code with custom buttons and content

var vContent = $('<label style="display: inline-block; padding: 10px 20px 20px 20px;">First name:<input style="display: block;"></label>');
var vDialog = new af.controls.Dialog({
    overlay: { clickCloses: true }, // does what you'd expect
    buttons: { close: true }, // enables the close button in the header
    title: "My Test Dialog",
    content: vContent,
    destroyOnClose: true, // will dispose of the dialog after it closes
    buttonbar: [
        { text: "I have entered my first name", highlight: true,
            click: function() {
                alert("Your name is: " + $(vDialog.getElement()).find("label > input").val());
                vDialog.close();
            }
        },
        { text: "Get me out of here", click: function() { vDialog.close(); } }
    ]
});

vDialog.show();

components web · Perma link post comment Posted by: Jan Henrik H. Meling (14-mai-2012)