how can i add external pages.? to Replace “<template id=“page.html”></template>” Actually what i mean the settings & about pages are inside index.html file like “<template id=“About.html”>…</template>”. So can i include that files separately.?
I seem to have an issue with the methode: setActiveIndex(). It only seems to effective when a page is actually loaded and shown.
My page is built in a way as shown below and I want the carousel to dynamically move to a specific item
during the init of the page, based on a provided parameter.
<ons-carousel swipeable auto-scroll overscrollable id=“carousel”>
To achieve this I use something like the code below during the page init event:
var myCarousel = document.querySelector('#carousel');
(zero based array)
Testing the value with getActiveIndex() shows that setting the index worked, but when the page is shown always the first carousel item is show. regardless of the set value.
When I apply the same code in the ‘show’ event it works, just like with a button click event on the page. Can be due to the fact the items are not added to the DOM yet at init phase? Well I could live with that, but the jump to the set item is noticeable and that is really not great.
What do I do wrong and would be a solution for this?
Hello, how to set input controls as datepicker? I wrote inside:
type=“date” but after run this control shows text: dd.mm.gggg underlined, and if I click on it then appears calendar where is possbile to pick a day. After that finally date text appears as expected. How to set initially system date? Thanks
@jpwright It has options.callback. The description says Extends alert() parameters., which means that it implements all the parameters of ons.notification.alert plus its own paramenters. It also returns a promise with the string, which can be used instead of the callback.
@tienlbhoc Look at “load more” functionality (onInfiniteScroll, without lazyRepeat). That’s a better way to deal with async calls. Otherwise, in delegate.createItemContent you can synchronously return an empty new item and then asynchronously modify its content when the data is ready.
@barklund I understand what you are saying and agree in regards to separation of concerns. I would say that I would think the intent of modifier was to provide some canned classes and an easy way to implement them with exposing contradicting user styling via the style attribute.
I would be interested in why, as far as SoC goes, you think using style="classname" is worse than using modifier="classname"? In my opinion, they are the same thing. Now, I would agree that if the Onsen team implements something for one element, it would be nice for it to be consistent across all the elements.
Having said that, since navigator is their base navigation element (like the carousel), they are consistent in not having modifier.