JoshDSommer / nativescript-slides

A NativeScript plugin that is for Intro Tutorials, Image Carousels or any other slide functionality
Other
70 stars 32 forks source link

How to Programmatically add slides #55

Closed poorcoder closed 8 years ago

poorcoder commented 8 years ago

At the beginning I don't have any slide in my hand all slide content comes from http request... I need a way to create the slides on the fly... I no result from http requests I have to show not found ui for the user...

I am not using Angular... JS + xml...

How can I do this... Thanks

JoshDSommer commented 8 years ago

Morning @poorcoder if you check out this https://github.com/TheOriginalJosh/nativescript-slides/blob/master/demo/app/views/dynamic-page.ts it gives an example how to add slides dynamically. I hope that helps. Let me know if that works for you.

Going to close this issue for the time being, but if it continues to be an issue feel free to open it back up.

Thanks!

poorcoder commented 8 years ago

Thank you for your quick response... I tested that It's working nice but not solving my problem or I am doing something wrong...

I have 15 backend services I am making 15 reqs... What I want to do when I receive the first response I want to show result at first slide than append the others If there is more results...

JoshDSommer commented 8 years ago

@poorcoder unfortunately that isn't something I'm able to support at the moment, you may be able to get it working with a combination of adding the slide dynamically and then calling the constructView function after a slide has been added to build the slides.

poorcoder commented 8 years ago

Thank you...

poorcoder commented 8 years ago

@TheOriginalJosh How I can call constructViewcan you pls show a small snippet...

JoshDSommer commented 8 years ago

Hey man, sorry Ididn't get back to you sooner.

Basically give the slides and ID and use getViewById to get them then simply call mySlides.constructView(); I hope that helps