Ignore:
Timestamp:
07/23/12 13:07:24 (13 years ago)
Author:
hendrikvanantwerpen
Message:

Seperated question browser in TabbedQuestionBrowser? widget.
Made configuring Selector actions more flexible (both for top actions and item actions).
Fixed lowercase/uppercase problem in SurveyListView?.
Fixed whitespace and toolyip in LineWithActionsWidget?.
Added question browser to questions page. Removed the old dialog that was there and redirect to questionEditor page.

File:
1 edited

Legend:

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

    r366 r370  
    1 define(['dojo/_base/declare','dojo/_base/lang','dojo/_base/event',
    2     'dojo/_base/Deferred','rft/store','rft/ui/_Page','rft/ui/AccordionList', 'rft/content'],
    3     function(declare,lang,event,Deferred,store,_Page,AccordionList,content) {
     1define([
     2    'dojo/_base/declare',
     3    'dojo/_base/Deferred',
     4    'dojo/_base/event',
     5    'dojo/_base/lang',
     6    'rft/content',
     7    'rft/store',
     8    'rft/ui/_Page',
     9    'rft/ui/TabbedQuestionBrowser'
     10    ],function(declare,Deferred,event,lang,content,store,_Page,TabbedQuestionBrowser) {
    411        return declare('rft.pages.questions',[_Page],{
    512            constructor: function() {
    613                this.inherited(arguments);
    7                 this.questions = {};
    814            },
    915            onVisit: function() {
    10                 debugger;
    11                 this._list = new AccordionList({
    12                     actions: {
     16                this.questionBrowser = new TabbedQuestionBrowser({
     17                    region: 'center',
     18                    'class': 'blue',
     19                    itemActions: {
    1320                        'Edit': {
    14                             callback: lang.hitch(this,'_editQuestion'),
    15                             properties: {
    16                                 blockButton: true,
    17                                 icon: "Edit",
    18                                 label: "Edit"
    19                             }
     21                            callback: lang.hitch(this,"onEditQuestion"),
     22                               icon: 'Edit',
     23                               description: 'Edit question'
    2024                        }
    21 
    22                        
    23                     },
    24                     idProperty: store.idProperty,
    25                     categoryProperty: 'category',
    26                     titleProperty: 'title'
    27                 },this.list);
    28                 this._list.startup();
    29                 this._refresh();
     25                    }
     26                },this.questionBrowser);
     27                this.questionBrowser.startup();
    3028            },
    3129            _refresh: function() {
     
    3836                Deferred.when(store.add({type:'Question'}))
    3937                .then(lang.hitch(this,function(question){
    40                     this._editQuestion(question);
     38                    this.onEditQuestion(question);
    4139                }));
    4240            },
    43             _editQuestion: function(question) {
     41            onEditQuestion: function(question) {
    4442                content.goTo("question", {uid: question._id});
    45                 // this.questionForm.reset();
    46                 // this.questionWidget.set('value',question);
    47                 // this.questionDialog.show();
    48             },
    49             onSaveQuestion: function(evt) {
    50                 var value = this.questionWidget.get('value');
    51                 Deferred.when(store.put(value))
    52                 .then(lang.hitch(this,function(){
    53                     this.questionDialog.hide();
    54                     this.questionForm.reset();
    55                     this._refresh();
    56                 }));
    57                 event.stop(evt);
    58                 return false;
    59             },
    60             onCancelQuestion: function() {
    61                 this.questionDialog.hide();
    62                 this.questionForm.reset();
    6343            }
    6444        });
Note: See TracChangeset for help on using the changeset viewer.