Usage of the Metro Javascript library


Paolo Lops
Hi David, if i have two views and from the first with a javascript function i want handle the second how i can do? tabks Paolo

DecSoft

Hello Paolo,

Yes; you can use the below Javascript instead of the "ShowView" action:



Paolo Lops
David, i dont want show the view but refer to it before show to use it like a subform or child form of the main....

DecSoft

Hello Paolo,

I know that I miss something... however we can't do something like that, since, certainly we have the HTML of a view in an external file, so, in principle, we can access to it if needed, but, that HTML template of the view is not processed, so, probably we can't work with it.

May you can use a Javascript variable? Then yes... you can access to that variable from one or another view...



Paolo Lops
David, i have solved it with a container control.... the resoult is this... http://general-soft.com/Schizzo.png in the right the container within a new window... i'm using also this https://metroui.org.ua/

DecSoft

Very good! :-)



Paolo Lops
i have sent you an email with source... i you like you can share with all.

DecSoft

Yes; of course, I want to take a look if possible. :-)



Paolo Lops
David, today i have sent you another email of my demo app

Paolo Lops
I have mentioned you here: https://forum.metroui.org.ua/viewtopic.php?f=7&t=175

DecSoft

Thanks Paolo. :-)

So you already sent to me the sample app that you mentioned? I did not receive nothing yet...



Paolo Lops
yes on your gmail account

DecSoft

It's quite rare, because I did not receive nothing... but when I say nothing is nothing... nor the email nor a warning from GMail... Maybe you include a zip file attached or something like that? If so... look if you can place that zip file in your server, and then send to me an URL to download the zip file...



DecSoft

Thanks! I got your latest email now! Let me to take a look, Paolo. :-)



DecSoft

Hello to all,

It's quite curious, Paolo. :-) Just one thing to note: since jQuery is already available in AB apps, we no need to include jQuery to our apps. You can remove the jQuery Javascript file from the app's files manager and can see the app working like before. :-)



Paolo Lops
Hi David, yes i have removed it from AB. What do you think about it? I'm working to discovery the way to clone a container with all properties and events to load it many times... i you like it we can work togather also with the AB comunity to build a Desktop like platform to build web apps..this is my wish !! =) regards Paolo

Paolo Lops
Hi David, i i insert in View1 an HTMLContent Control with ng-include src="'/app/views/View2.html'" (see https://www.html.it/pag/53029/ng-include/) then i'm able to load View2 in View1 but script code of View2 is not in the current scope. To avoid this i must create functions like Button3Click if in View2 i have a Button with id Button3 and i must put all my code inside.. There are more elegants methods?

DecSoft

Hello Paolo,

If I am right, what you wanted is to place an arbitrary HTML, including some events. We can use Javascript in order to add HTML to some HTML Control or a Container control, and then, prepare the right events for the new HTML also using Javascript.

Since the jQuery library is included in our apps by default, probably it's good to take advantage of that. I already use jQuery to append HTML code to an HTML control or Container control, and be ready with that HTML events also using jQuery.

For example, take a look at this sample app, who add an arbitrary number of "buttons" to an HTML control, and, also take care about the new buttons's Click event:

https://www.decsoftutils.com/temp/html.zip

If we need too much HTML, maybe can be good to place it in an HTML file, then include that HTML file using the app's Files Manager, and, continue using jQuery to handle the appropriate events.

Please, Paolo, take a look at the above sample and tell me if you have any further question.


Todo el mundo puede leer el foro de soporte de DecSoft para aprender del mismo, sin embargo, sólo los clientes de DecSoft pueden abrir nuevos hilos. Compre una o más licencias de productos de DecSoft y obtendrá este y otros beneficios.

Este sitio utiliza "cookies" útiles para almacenar sus preferencias.

Bien. Ocultar esta nota. Obtener más información.