Mario
Mario

Reputation: 11

Accessing the TitleBar close event from a grid button

I am launching a shieldwindow from shield Tree View. The shieldwindow has a single ‘close’ button on the TitleBar as per code below:

var dbwindow = $("#mapworkpanel").shieldWindow({
        width: "60%",
        height: "100%",
        appendToBody:false,
        draggable: false,
        position: { left: 700, top: 0 },
        title: "Dictionary Definitions",
        titleBarButtons: [ 'close' ],
        events: {
            close: function(e) {
            //
            }
        },
        content: {
               remote: {
                   url:thisurl,
                   iframe: true,
               }
            },
        modal: false,
    }).swidget();

The URL launches a shield UI grid with a few buttons including a Close Button.

When I click the “x” button on the Titlebar the form closes with no issues.

How can I access the TitleBar close button from the Close Button on the grid?

I appreciate any suggestions.

Thanks, Mario

Upvotes: 1

Views: 72

Answers (1)

Brad
Brad

Reputation: 11

Hopefully I'm understanding your question correctly, but I'm not sure why you need access to the actual title bar's close button. In the case you're just looking to close the window an additional way, there's an API function in the Shield Window widget for that. Assuming your dbwindow reference is available, you should just be able to call dbwindow.close() in the event handler for your grid's close button.

Upvotes: 1

Related Questions