Ignore:
Timestamp:
04/29/13 19:35:10 (12 years ago)
Author:
hendrikvanantwerpen
Message:

Big cleanup of the question content.

  • Replaced old list implementations with a new one that behaves like a form widget.
  • All question content is now in separate widgets, not in the factory itself.
  • Added form and widget validation for question editing.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • Dev/trunk/client/qed/model/widgets/QuestionListView.js

    r426 r441  
    11define([
    2     'dojo/_base/declare',
    3     'dojo/_base/lang',
    4     'dojo/dom-construct',
    5     '../../widgets/LineWithActionsWidget',
    6     '../../widgets/list/OrderedList'
    7 ],function(
    8     declare,
    9     lang,
    10     domConstruct,
    11     LineWithActionsWidget,
    12     OrderedList
    13 ){
    14     return declare([OrderedList],{
     2    "../../widgets/LineWithActionsWidget",
     3    "../../widgets/ListWidget",
     4    "dojo/_base/declare",
     5    "dojo/_base/lang",
     6    "dojo/dom-construct"
     7], function(LineWithActionsWidget, ListWidget, declare, lang, domConstruct) {
     8    return declare([ListWidget],{
    159        baseClass: 'rftSurveyListView',
    1610        type: 'question',
    1711
    18         _createAvatarNode: function(item){
     12        createAvatar: function(id, item){
    1913            return domConstruct.create("div",{
    2014                'class': 'dragAvatar',
     
    2216            });
    2317        },
    24         _createListNode: function(item) {
     18        createListElement: function(id, item) {
    2519            var w = new LineWithActionsWidget({
     20                id: id,
    2621                title: item.title,
    2722                'class': "inheritBgColor",
    2823                actions: {
    2924                    "Remove" : {
    30                         callback: lang.hitch(this, 'removeItem', item),
     25                        callback: lang.hitch(this, 'removeItem', id),
    3126                        properties: {
    3227                            blockButton: false,
     
    4843            });
    4944            w.startup();
    50             return w.domNode;
     45            return w;
    5146        }
    5247    });
Note: See TracChangeset for help on using the changeset viewer.