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.