2

我正在尝试更改 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="#">&times;</a></span><span class="add-on"><div class="red" id="<%- idDivCantidadResultados %>"></div></span></div>'),

但我不知道如何改变。

4

1 回答 1

3

只需将其放入构造函数中即可。

var filter = new Backgrid.Extension.ClientSideFilter({
  template: _.template("<...>",  /* Underscore template context */ {foo: bar}),
  collection: collection,
  fields: ['field']
});

http://underscorejs.org/#template

于 2014-01-18T14:45:48.770 回答