好吧,我创建了一个事件,以便选中多个复选框,如果它们是手动的,它应该将这些复选框分配给受让人,但如果不是,它们应该是。这是视图功能,
assignUserClicked : function() {
var self = this;
var modal = new AssignmentUserModalView({
collection: this.getSelected()
}).open();
this.model.save({
integrationlevel: 'manual'
}, {
type: 'POST',
wait: true
});
var self = this;
var refresh = function (model) {};
this.listenTo(modal, 'ok', function () {
self.model.fetch({
data: {
exportid: self.model.id
}
});
});
modal.open();
},
tmpl 在下面,
<div class="btn-toolbar pull-right">
<div class="btn-group" title="Bulk Actions">
<button class="btn dropdown-toggle btn-primary" data-toggle="dropdown">
<span class="glyphicon glyphicon-th-list"></span>
Bulk Actions
<span class="caret"></span>
</button>
<ul class="dropdown-menu">
<h3 class="pull-left no-margin">
<%= name %>
<small>-
<%= exportid %></small><% if (integrationlevel== 'manual') { %>
<small>-</small>
<small class="text-danger">NON CHANGEABLE</small><% } %>
<%= exportid %>
</h3>
<li>
<% if (integrationlevel == 'automatic'|| integrationlevel== 'Automatic'){ %>
<a href="javascript:void(0);" id="ud_changetomanual" tabindex="-1">
<span class="glyphicon glyphicon-ok"></span>
Set to manual
</a>
<% } else { %>
<a href="javascript:void(0);" id="ud_assignee" tabindex="-1">
<span class="glyphicon glyphicon-user"></span>
Change Assignment
</a>
<% } %>
</li>
</ul>
</div>
它给了我一个错误,说没有定义 exportid,有什么想法吗?