Framework7: Close smart select in picker with JavaScript

Created on 23 Jun 2016  路  11Comments  路  Source: framework7io/framework7

Hi everyone!
I'm developing my first app for Android using Framework7 and I'm trying to close a smart select with javascript.
On the website i saw a method for open smart select with js:
myApp.smartSelectOpen(smartSelect)

Is there something similar for close?
I also tried to trigger a click event on "close-picker" ($(".close-picker:eq(0)").trigger("click")) but this is not working while alert($(".close-picker:eq(0)").html()) is working.

Thanks and sorry for my bad english :(

Android bug Bug confirmed outdated

Most helpful comment

What about something like this:

if ($('.smart-select-picker.modal-in').length > 0) {
myApp.closeModal('.smart-select-picker.modal-in');
}

All 11 comments

indicate this property
data-back-on-select="true"

// data-back-on-select="true" to close page automatically

    <li><a href="#" class="item-link smart-select" data-back-on-select="true">

.

Thanks. This works but what I really need is that if the back button on android is clicked and the smart select is visible then close the smart select. I can override the backbutton event and check if smart-select is visible but i can't close it

you can show screenshoot

Sorry for the late response :(
So, I'm in this situation.
I want that if the user press the android back button, then the smart select will close.
screenshot_20160627-084223

Try: mainView.router.back()

that will take the user back a page. not what was asked for

Well, i had the same issue: close openned smartSelect using android back button, and i solved like that. I dont used picker but searchbar and worked very well.

yeah because you probably had smartSelect as a page so going back would close it

What about something like this:

if ($('.smart-select-picker.modal-in').length > 0) {
myApp.closeModal('.smart-select-picker.modal-in');
}

@sfontana7 I tried everything mentioned above before finding this thread and your solution was the only thing that worked for me.

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

ichingsoft picture ichingsoft  路  4Comments

iBinJubair picture iBinJubair  路  5Comments

iBinJubair picture iBinJubair  路  4Comments

ahmeddaif1 picture ahmeddaif1  路  4Comments

J05HI picture J05HI  路  3Comments