Smart select won't work in a sheet modal

Hi,
I replaced a developer that built out an app with framework7 for our employees to checkout assets. I am trying to implement a smart select dropdown with a search bar to improve functionality a bit, but am having a hard time.
I found a few older threads that covered this topic, but none of the solutions addressed my issue as I’m still getting the errors “Framework7 is already initialized and can’t be initialized more than once” and “smart select requires initialized view”.

Here is a snippet of my code:

	echo '<ul>
		    <li>
			   <a class="item-link smart-select smart-select-init" data-open-in="sheet"  data-searchbar="true" data-searchbar-placeholder="Search Employees">
				    <div class="item-content">
						<div class="item-inner">
							<div class="item-title">Employee</div>
								<select id="empidSelector" name="eid" class="'.$chosenSelect.'">
									<option value=\"\" selected>-Check in/out For-</option>';

										$sql = "SELECT id,firstName,lastName FROM users WHERE terminationDate < 1 AND groupId IN (".$gid.") AND id NOT IN (SELECT userId FROM id_user_key_privileges WHERE privilegeId = 4) ORDER BY `firstName`";
											echo "<option value=\"".$forUserId."\">".$_COOKIE['SlsID_my_site']."</option>";
										$result = $mysqli->query($sql);
										while ($row = $result->fetch_assoc())	{

                                        echo "<option value=\"".$row['id']."\">".$row['firstName']." ".$row['lastName']."</option>";
										}

                                        echo ' </select>
	                                          </div>
	                                         </div>
	                                        </a>
                                           </li>
                                          </ul>';

What do I need to do to get this working?
Thanks for your time and your help.

Sorry, but at this release point, there is no way to do smart select works in sheet modal :’(

There are another thousand questions about this here in the forum, them all with the same answer: “No way to do it”.

@nolimits4web and @shastox write to many answers, I try it all with no success.

seems like SmartSelect needs a VIEW to work, but there is no way to add them, even use the params or create them dynamically, just don’t work.

I know frustrating, but its real life.

I hope someday we can find an answer, a real one!

I was building an app with SmartSelect in SheetModal, when I realize something I ll publish in the forum.

This is not true, it is not hard to do it and possible. Provide at least minimal JSFiddle with what you have tried and you will get help

2 Likes

This snipped doesn’t tell anything without context, where do you add, when, etc.

1 Like

example with Smartselect in sheet-modal:

jsfiddle

2 Likes

when sheet modal open, press top “back” link :slight_smile:

it just a sample code, you should prevent naviagtion… its a POC that its posible to use smartselect inside sheet-modal

Of course its possible:

Modals can routable as well. By Modals here we mean the following components: Popup, Popover, Actions Sheet, Login Screen, Sheet. Probably Popup and Login Screen have more use cases here.
https://framework7.io/docs/routes.html#routable-modals

sorry didn’t understand. I just write a small fiddle to show @nuropa how it can be done. i didn’t mention anything about router.
i don’t understand your point. is wrong my fiddle? maybe it can be done better, if that’s the case, can you show how?

1 Like

@nolimits4web I use framework7 in all projects, I have created a question and searched a lot, like a week.

So, now I see a jsfiddle working well, then I ll try and post my feedback.

but, @pvtallulah just show me that its possible, so, i was wrong. Sorry @swacinet

Sorry, my english is bad