You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on May 17, 2018. It is now read-only.
My Collection:
var $ = jQuery = require('jquery'),
Backbone = require('backbone'),
_ = require('underscore'),
Urls = require('../../libs/urls'),
services = require('../../libs/services'),
skuListModel = require('../../models/sku/SkuListModel'),
PageableCollection = require("backbone-pageable");
var SkuListCollection = Backbone.PageableCollection.extend({
model: skuListModel,
sync: function (method, model, options) {
options = _.defaults({}, options, {
readUrl: Urls.sku.list
});
return services.sync.call(model, method, model, options);
},
state: {
firstPage: 1,
currentPage: 1,
pageSize: 10
},
queryParams: {
currentPage: "page",
pageSize: "limit",
totalPages: this.totalPages
},
searchOnParameter: function (search_string) {
console.log(search_string);
return this.fetch({
data: {
search_string: search_string
}
})
},
parse: function (response) {
if (_.has(response, "metadata")) {
this.totalPages = Math.ceil(response.metadata.record_count / 10);
this.skus = response.records;
this.totalRecords = response.metadata.record_count;
this.currentPage = this.state.currentPage;
return response.records;
}
}
});
module.exports = SkuListCollection;
When i call it in the View
searchData: function (e) {
var self = this;
}
It appends the result with the current collection how do i solve this issue.
The text was updated successfully, but these errors were encountered: