我正在尝试更改Backgrid.Extension.ClientSideFilter
template: _.template('<div class="input-prepend input-append"><span class="add-on"><i class="icon-search"></i></span><input type="text" <% if (placeholder) { %> placeholder="<%- placeholder %>" <% } %> name="<%- name %>" /><span class="add-on"><a class="close" href="#">×</a></span><span class="add-on"><div class="red" id="<%- idDivCantidadResultados %>"></div></span></div>'),
但我不知道如何改变。
答案 0 :(得分:3)
将它放入构造函数中。
var filter = new Backgrid.Extension.ClientSideFilter({
template: _.template("<...>", /* Underscore template context */ {foo: bar}),
collection: collection,
fields: ['field']
});