我使用Backbone和jqm。我最近将jqm从1.3.1升级到1.3.2。我使用的是jquery 2.0.3。
我根据加载的骨干视图启用和禁用linkbindingEnabled。如果视图有
在1.3.1中,当我点击列表视图时,效果很好。显示列表,我可以选择一个选项。
但是在1.3.2中,当我点击listview时,listview会显示所有选项,然后在jquery Sizzle.error中抛出一个异常,它说"错误:语法错误,无法识别的表达式:#&#34 ;
以下代码是用于在jqm中创建列表的HTML代码。
<div data-role="content">
<ul data-role="listview" data-theme="d" data-divider-theme="d">
<li data-role="list-divider">
<fieldset data-role="controlgroup" data-type="horizontal" data-mini="true">
<label for="select-status">Status</label>
<select name="select-status" id="select-status" data-prevent-focus-zoom="true" data-theme="d" data-overlay-theme="d" data-iconshadow="false"
data-native-menu="false" multiple>
<option value="all">All</option>
<option value="open">Open</option>
<option value="completed">Completed</option>
<option value="cancelled">Cancelled</option>
</select>
<select name="select-dates" id="select-dates" data-prevent-focus-zoom="true" data-theme="d" data-overlay-theme="d" data-native-menu="false" data-iconshadow="false">
<optgroup label="Day">
<option value="Yesterday">Yesterday</option>
<option value="Today">Today</option>
<option value="Tomorrow">Tomorrow</option>
<option value="All">All days</option>
</optgroup>
<optgroup label="Week">
<option value="ThisWeek">This Week</option>
<option value="LastWeek">Last Week</option>
<option value="NextWeek">Next Week</option>
</optgroup>
</select>
</fieldset>
<span style="display: none; padding-left: 5px;">
<a id="a15" href="#" data-rel="popup">
<img id="imgFilter" src="~/Content/images/filter.png" alt="filter" />
</a>
<span id="spanFilterText">All Appointments</span>
</span>
</li>
</ul>
</div>
在我的骨干路由器中,我有一个像这样加载的视图
var AppRouter = Backbone.Router.extend({
home: function () {
this.models.AppointmentList = new AppointmentList();
var view = new HomePageView({ model: this.models.AppointmentList });
$.mobile.linkBindingEnabled = false;
},
agenda: function () {
if (!this.models.AppointmentList)
this.models.AppointmentList = new AppointmentList();
var view = new AgendaPageView({ model: this.models.AppointmentList })
$.mobile.linkBindingEnabled = true;
},
});
有什么想法吗?