Anshika
December 11, 2018, 11:26am
1
I am trying to create smart select dynamically- but it is redirecting to 404.html page instead. Following are the codes -
Javascript
app.smartSelect.create({el:’.testsel’,view: app, openIn : ‘popup’});
HTML -
<li> <a class="item-link smart-select smart-select-init testsel" data-searchbar="true" data-searchbar-placeholder="Select data" data-open-in="popup" >
<select name="abc" onchange="somefunction(this.value)">
<option value="all" selected>All</option> </select>
<div class="item-content">
<div class="item-inner">
<div class="item-title"><b>Input Data</b></div>
</div>
</div>
</a>
</li>
You initialize it twice. Once with smart-select-init class and also with JS api. Use something one
Anshika
December 12, 2018, 4:46am
3
I have removed - ‘smart-select-init’ still it is redirecting to 404.html only.
Basically this HTML code is embedded to the page through ajax call and after that we call javascript to initialize it. Please suggest.
Would be good to see live example or JSFiddle
Anshika
December 13, 2018, 6:21am
5
The issue is resolved by correctly defining the view while creating smart-select. I don’t use fiddle so unable to share complete code. Thanks.
app.smartSelect.create({el:’.testsel’,view: app.views.current , openIn : ‘popup’});