Changeset 343 for Dev/branches/rest-dojo-ui/client/rft/pages/questions.js
- Timestamp:
- 06/18/12 12:51:58 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
Dev/branches/rest-dojo-ui/client/rft/pages/questions.js
r316 r343 8 8 }, 9 9 onVisit: function() { 10 this._store = store.getStore('Question');11 10 this._list = new AccordionList({ 12 11 actions: { 13 12 'Edit': lang.hitch(this,'_editQuestion') 14 13 }, 15 idProperty: this._store.idProperty,14 idProperty: store.idProperty, 16 15 categoryProperty: 'category', 17 16 titleProperty: 'title' … … 21 20 }, 22 21 _refresh: function() { 23 Deferred.when( this._store.query())22 Deferred.when(store.query('_design/default/_view/by_type',{key: 'Question'})) 24 23 .then(lang.hitch(this,function(items){ 25 24 this._list.setItems(items); … … 27 26 }, 28 27 onNewQuestion: function() { 29 Deferred.when( this._store.add({}))28 Deferred.when(store.add({type:'Question'})) 30 29 .then(lang.hitch(this,function(question){ 31 30 this._editQuestion(question); … … 39 38 onSaveQuestion: function(evt) { 40 39 var value = this.questionWidget.get('value'); 41 Deferred.when( this._store.put(value))40 Deferred.when(store.put(value)) 42 41 .then(lang.hitch(this,function(){ 43 42 this.questionDialog.hide();
Note: See TracChangeset
for help on using the changeset viewer.