mirror of
https://github.com/lidarr/lidarr.git
synced 2025-07-13 16:43:58 -07:00
updated backgrid, pageable
This commit is contained in:
parent
30a55c465a
commit
9515064f14
4 changed files with 616 additions and 282 deletions
|
@ -50,6 +50,15 @@
|
|||
Backbone.View.prototype.initialize.apply(this, arguments);
|
||||
this.name = options.name || this.name;
|
||||
this.placeholder = options.placeholder || this.placeholder;
|
||||
|
||||
var collection = this.collection, self = this;
|
||||
if (Backbone.PageableCollection &&
|
||||
collection instanceof Backbone.PageableCollection &&
|
||||
collection.mode == "server") {
|
||||
collection.queryParams[this.name] = function () {
|
||||
return self.$el.find("input[type=text]").val();
|
||||
};
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
|
@ -59,9 +68,8 @@
|
|||
*/
|
||||
search: function (e) {
|
||||
if (e) e.preventDefault();
|
||||
var $text = $(e.target).find("input[type=text]");
|
||||
var data = {};
|
||||
data[$text.attr("name")] = $text.val();
|
||||
data[this.name] = this.$el.find("input[type=text]").val();
|
||||
this.collection.fetch({data: data});
|
||||
},
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue