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

Dynamically create a modalview

3 Answers 142 Views
ModalView
This is a migrated thread and some comments may be shown as answers.
Anthony
Top achievements
Rank 1
Anthony asked on 29 Jul 2014, 02:28 PM
Hi
  Is this possible? I would like to create a modalview via an ajax call, possibly then destroy it and make another one?

On that topic is this possible with normal views as well, I gather they aren't made until navigate is called but I haven't tried to replace them after they've been made

thanks

3 Answers, 1 is accepted

Sort by
0
Kiril Nikolov
Telerik team
answered on 31 Jul 2014, 07:28 AM
Hi Anthony,

I am afraid that loading remote model views is not supported at the moment. I would suggest you to include the modal view with all the other views and just change its content whenever needed. 

As for the standard views, you can use remote views in separate HTML files that will be loaded with an automatic AJAX call by the mobile application. Here is a demo of it:

http://demos.telerik.com/kendo-ui/mobile-view/index

Regards,
Kiril Nikolov
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
0
Anthony
Top achievements
Rank 1
answered on 31 Jul 2014, 07:43 AM
I suspect it's the same answer but just to clarify

What I would like to be able to do is something like this:

<div id=container></div>

I'd like to, via javascript, replace the above div with a modalView, presumably then calling some kind of initialization function on it and finally calling a function to make it appear.

The same would also be useful for a view, and with a view it seems like it should be possible given that the remote view functionality must do something similar

This would then give me more flexibility when returning partial views in MVC

thanks

0
Kiril Nikolov
Telerik team
answered on 01 Aug 2014, 11:38 AM
Hi Anthony,

Content injecting in a mobile application is not supported, so the approach that you would like to use is not recommended. I would once again suggest you to just change the content in the already inserted elements in the mobile application as it is the recommended way to go.

Regards,
Kiril Nikolov
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
Tags
ModalView
Asked by
Anthony
Top achievements
Rank 1
Answers by
Kiril Nikolov
Telerik team
Anthony
Top achievements
Rank 1
Share this question
or