define(['app', 'jquery', 'underscore', 'backbone', 'model/categoryItem/categoryItemModel'], function (app, $, _, Backbone, Category){ var FoundItems=Backbone.Collection.extend({ dataFilter: null, initialize: function (options) { this.dataFilter = { titolo: options.titolo, difficolta: options.difficolta, categoryId: options.categoryId }; this.numItems = options.nResult; }, // Book is the model of the collection model:Category, url: function() { var u = myManifest.Settings.DefaultURL + "/api/categoryitems/search/" + this.numItems + "/" + this.dataFilter.categoryId + "/" + this.dataFilter.difficolta; if(this.dataFilter.titolo !== null) u += "/" + this.dataFilter.titolo; return u; } }); return FoundItems; });