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/survey.js

    r316 r343  
    55        return declare('rft.pages.survey',[_Page],{
    66            object: null,
    7             postCreate: function() {
    8                 this.inherited(arguments);
    9                 this._surveyStore = store.getStore('Survey');
    10                 this._questionStore = store.getStore('Question');
    11             },
    127            onVisit: function() {
    138                if ( this.pageArgs.uid ) {
    14                     Deferred.when(this._surveyStore.get(this.pageArgs.uid))
     9                    Deferred.when(store.get(this.pageArgs.uid))
    1510                    .then(lang.hitch(this,function(obj){
    1611                        this.object = obj;
     
    2116                        this.creator.innerHTML = (obj && obj.email) || 'unknown';
    2217                    }));
    23                     Deferred.when(this._questionStore.query())
     18                    Deferred.when(store.query('_design/default/_view/by_type',{key:'Question'}))
    2419                    .then(lang.hitch(this,function(items){
    2520                        this._questionList = new AccordionList({
    26                             store: this._surveyStore,
    2721                            actions: {
    2822                                'Add': lang.hitch(this,'_addQuestion')
    2923                            },
    30                             idProperty: this._questionStore.idProperty,
    3124                            categoryProperty: 'category',
    3225                            titleProperty: 'title'
     
    4437            onSave: function(evt) {
    4538                lang.mixin(this.object,this.form.get('value'));
    46                 Deferred.when( this._store.put(this.object) )
     39                Deferred.when( store.put(this.object) )
    4740                .then(lang.hitch(this,function(obj){
    4841                    this.object = obj;
     
    5346                }));
    5447                event.stop(evt);
     48                evt.stopPropagation();
    5549                return false;
    5650            },
Note: See TracChangeset for help on using the changeset viewer.