mmready-test /MVC/js/pieces/myExtendCollection.js

Language Javascript Lines 86
MD5 Hash fc9b6eea2c667cb63ed6cb9b2ccd7fb9
Repository https://github.com/GuggerJoel/mmready-test.git View Raw File View Project SPDX
| Open JSFiddle
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
//***************************************************************************//
//*******************           Collection            ***********************//
//***************************************************************************//


var MyCollection = Backbone.Collection.extend({
    parse: function (response) {
        // Gestion conditionnelle du format JSEND
        return typeof response.data != "undefined" ? response.data : response;
    }
});



var Events = MyCollection.extend({
    url: EVENTS, 
    model:Event
        //model: Instrument//diff de Chabloz lui il n'a rien
});

var Artists = MyCollection.extend({
    url: ARTISTS, 
    model:Artist
        //model: Instrument//diff de Chabloz lui il n'a rien
});


var Musicians = MyCollection.extend({
    url: MUSICIANS, 
    model:Musician
//    parse: function (attrs, opt) { chabloz parse dans l'extension de backbone
//        console.log("Into parse function of Musicians");
//        console.log("If typeof attrs != 'undefined'");
//        if (typeof attrs != "undefined") {
//            
//            console.log("THEN");
//            console.log("attrs.data is");
//            console.log(attrs.data);
//            return attrs.data;
//            
//        }else{
//            console.log("ELSE");
//            console.log("attrs.data de parse de Musicians : ");
//            console.log(attrs.data);
//            
//            return attrs.data;
//        }
//        
//    }
    
});

var Instruments = MyCollection.extend({
    url: INSTRUS, 
    model:Instrument
        //model: Instrument//diff de Chabloz lui il n'a rien
});

var Representers = MyCollection.extend({
    url: REPRESENTERS, 
    model:Representer
        //model: Instrument//diff de Chabloz lui il n'a rien
});
Back to Top