git-svn-id: https://msi/svn/firstRepo/WebClient/branches/NewRelease@33 0f545695-f87b-41b6-9a03-7f16563b5454

This commit is contained in:
2015-05-07 13:16:11 +00:00
parent d0d55ee8e5
commit 282ad76c48
79 changed files with 2416 additions and 1824 deletions
@@ -1,7 +1,7 @@
define(['app', 'jquery', 'underscore', 'backbone', 'model/categoryItem/categoryItemModel', 'classes/cachedCollection'],
function (app, $, _, Backbone, Category, CachedCollection){
var CategoryItems=CachedCollection.extend({
var CategoryItems = CachedCollection.extend({
categoryId: null,
initialize: function (options) {
+20 -7
View File
@@ -1,8 +1,11 @@
define(['app', 'jquery', 'underscore', 'backbone', 'model/categoryItem/categoryItemModel'],
function (app, $, _, Backbone, Category){
define(['app', 'jquery', 'underscore', 'backbone', 'model/categoryItem/searchItemModel'],
function (app, $, _, Backbone, SearchItem){
var FoundItems=Backbone.Collection.extend({
dataFilter: null,
numItems: null,
indexItems: null,
totalRecords: 0,
initialize: function (options) {
this.dataFilter = {
titolo: options.titolo,
@@ -10,14 +13,24 @@ define(['app', 'jquery', 'underscore', 'backbone', 'model/categoryItem/categoryI
categoryId: options.categoryId
};
this.numItems = options.nResult;
this.indexItems = options.indexItems;
},
parse: function(data){
this.totalRecords = data["0"].TotalRecords;
return data.records;
},
// Book is the model of the collection
model:SearchItem,
getTotalRecords: function(){
return this.totalRecords;
},
// Book is the model of the collection
model:Category,
url: function() {
var u = myManifest.Settings.DefaultURL + "/api/categoryitems/search/" + this.numItems +
var u = myManifest.Settings.DefaultURL + "/api/categoryitems/search/" +
this.numItems +
"/" + this.indexItems +
"/" + this.dataFilter.categoryId +
"/" + this.dataFilter.difficolta;
if(this.dataFilter.titolo !== null)
+18
View File
@@ -0,0 +1,18 @@
define(['jquery', 'underscore', 'backbone'],
function ($, _, Backbone){
var SearchItem = Backbone.Model.extend({
//default attributes
defaults: {
ricetta_id: "",
titolo: '',
autore: '',
valutazione: 0,
difficolta: 0,
categoria_name: 0
}
});
return SearchItem;
});