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

    r316 r343  
    88            },
    99            onVisit: function() {
    10                 this._store = store.getStore('Question');
    1110                this._list = new AccordionList({
    1211                    actions: {
    1312                        'Edit': lang.hitch(this,'_editQuestion')
    1413                    },
    15                     idProperty: this._store.idProperty,
     14                    idProperty: store.idProperty,
    1615                    categoryProperty: 'category',
    1716                    titleProperty: 'title'
     
    2120            },
    2221            _refresh: function() {
    23                 Deferred.when(this._store.query())
     22                Deferred.when(store.query('_design/default/_view/by_type',{key: 'Question'}))
    2423                .then(lang.hitch(this,function(items){
    2524                    this._list.setItems(items);
     
    2726            },
    2827            onNewQuestion: function() {
    29                 Deferred.when( this._store.add({}) )
     28                Deferred.when(store.add({type:'Question'}))
    3029                .then(lang.hitch(this,function(question){
    3130                    this._editQuestion(question);
     
    3938            onSaveQuestion: function(evt) {
    4039                var value = this.questionWidget.get('value');
    41                 Deferred.when( this._store.put(value) )
     40                Deferred.when(store.put(value))
    4241                .then(lang.hitch(this,function(){
    4342                    this.questionDialog.hide();
Note: See TracChangeset for help on using the changeset viewer.