Ignore:
Timestamp:
06/18/12 12:51:58 (13 years ago)
Author:
hendrikvanantwerpen
Message:

[Client] Changed store and pages to use CouchDB.
[Client] Disabled login for now, have to figure out some more details about CouchDB.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • Dev/branches/rest-dojo-ui/client/rft/pages/surveys.js

    r303 r343  
    33        return declare('rft.pages.surveys',[_Page],{
    44            selectedObject: null,
    5             postCreate: function() {
    6                 this._store = store.getStore('Survey');
    7             },
    85            onVisit: function() {
    9                 this.grid.setStore(ObjectStore({objectStore: this._store}));
     6                this.grid.setStore(
     7                    ObjectStore({objectStore: store}),
     8                    "_design/default/_view/by_type",{key:'Survey'});
    109               
    1110                this.grid.on('rowclick',lang.hitch(this,function(evt){
     
    1615                this.grid.on('rowdblclick',lang.hitch(this,function(evt){
    1716                    var obj = evt.grid.getItem(evt.rowIndex);
    18                     content.goTo('/survey',{uid:obj.getUid()});
     17                    content.goTo('/survey',{uid:store.getIdentity(obj)});
    1918                }));
    2019                               
    2120                this.btnNew.on('click',lang.hitch(this,function(){
    22                     Deferred.when( this._store.add({'creator':auth.getUser()}) )
     21                    Deferred.when( store.add({type:'Survey',creator:auth.getUser()}) )
    2322                    .then(function(obj) {
    24                         content.goTo('/survey',{uid:obj.getUid()});
     23                        content.goTo('/survey',{uid:store.getIdentity(obj)});
    2524                    });
    2625                }));
     
    2827                this.btnEdit.on('click',lang.hitch(this,function(){
    2928                    if ( this.selectedObject ) {
    30                         content.goTo('/survey',{uid:this.selectedObject.getUid()});
     29                        content.goTo('/survey',{uid:store.getIdentity(this.selectedObject)});
    3130                    }
    3231                   
Note: See TracChangeset for help on using the changeset viewer.