This is a migrated thread and some comments may be shown as answers.

Immediate reopen Mobile ModalView fails

2 Answers 29 Views
ModalView
This is a migrated thread and some comments may be shown as answers.
Oleg
Top achievements
Rank 1
Oleg asked on 05 Jul 2018, 11:36 AM

Hello,

 

I have a Kendo UI Mobile ModalView that I use as a message dialog. It is rather simple (html code below),

and used to work fine by calling open and close methods and changing view data in between.

Now I have a situation where the modal view is already open and needs to be closed and

immediately reopened again with new data. It goes like this:

$("#modalview-alert").data("kendoMobileModalView").close();

changeSomeAlertData();  // update title and message text

$("#modalview-alert").data("kendoMobileModalView").open();  // opens view but immediately closes it

However the view doesn't reopen, apparently previous close method closes it too.

I tried to put a delay around close and I see that the view is reopened but immediately

closed after delay expires. Later on reopen works OK, this problem only happens if

open is done immediately after close. How can I close and immediately open the modal view again?

Thanks.

 

ps I use it on Android 7.0, Samsung Internet.

 

Regards,

Oleg

    <div data-role="modalview" id="modalview-alert" data-close="onModalViewAlertClose">
        <div data-role="header">
            <div data-role="navbar">
                <span id="modalview-alert-title"></span>
                <a data-click="closeModalViewAlert" data-role="button" data-align="right">X</a>
            </div>
        </div>
        <div id="modalview-alert-body" style="position: relative">
            <div id="modalview-alert-message"></div>
        </div>
        <div data-role="footer">
            <div id="modalview-alert-buttons" data-role="navbar"></div>
        </div>
    </div>

2 Answers, 1 is accepted

Sort by
0
Veselin Tsvetanov
Telerik team
answered on 09 Jul 2018, 07:04 AM
Hi Oleg,

Here you will find a small sample following the snippets sent, in which I have tried to replicated the described scenario. You will notice that after closing the Modal by using the X button, it is being immediately reopened. In order to achieve that I had to timeout the open() method call. This is due to the transition animation duration for the close, which needs to finish before the open() is being called.

If this does not cover your scenario, please modify the sample so it replicates it and send it back to us. This way we will be able to troubleshoot the problem locally and to provide you with the most appropriate assistance for this case.

Regards,
Veselin Tsvetanov
Progress Telerik
Try our brand new, jQuery-free Angular components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
0
Oleg
Top achievements
Rank 1
answered on 10 Jul 2018, 11:16 AM

Hi Veselin,

Didn't realize that it's open() method call that needs to be delayed.

I tried it and it seems to work, though I had to put a longer delay.

Thanks for the fast response.

 

Regards,

Oleg

Tags
ModalView
Asked by
Oleg
Top achievements
Rank 1
Answers by
Veselin Tsvetanov
Telerik team
Oleg
Top achievements
Rank 1
Share this question
or