locked
Modal Dialogue Screen RRS feed

  • Question

  • I am working in light switch HTML Client. I have a screen that opens a Modal screen, the new Modal , opens another. I need to close all modal screens when I click  in the X to close the top most screen. How can I do that?

    Thanks in advance.

    Monday, July 14, 2014 3:58 AM

Answers

  • You can do this by using myapp.navigateBack in the afterClosed argument of showScreen like so:

    myapp.AddEditOrder.OrderDetails_ItemTap_execute = function (screen) {
    
        myapp.showAddEditOrderDetail(screen.OrderDetails.selectedItem, {
            beforeShown: function () {
                //do something before screen shown here
            },
            afterClosed: function () {
                //close prior screen here
                myapp.navigateBack();
            }
        });
    };

    HTH,

    Josh

    • Proposed as answer by Paul Van Bladel Tuesday, July 29, 2014 7:56 AM
    • Marked as answer by Angie Xu Thursday, July 31, 2014 7:17 AM
    Monday, July 28, 2014 7:10 PM