Ignore:
Timestamp:
07/24/12 16:39:41 (13 years ago)
Author:
jkraaijeveld
Message:

Can now edit basic question properties and store them.

File:
1 edited

Legend:

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

    r364 r374  
    11define([
    22    'dojo/_base/declare',
     3    'dojo/_base/lang',
    34    'dijit/_WidgetBase',
    45    'dijit/_TemplatedMixin',
    56    'dijit/_WidgetsInTemplateMixin',
    67    'dijit/_Container',
     8    'rft/ui/LineWithActionsWidget',
    79    'dojo/text!./templates/List.html'
    810    ],function(
    911        declare,
     12        lang,
    1013        _WidgetBase,
    1114        _TemplatedMixin,
    1215        _WidgetsInTemplateMixin,
    1316        _Container,
     17        LineWithActionsWidget,
    1418        templateString
    1519        ){
    1620        return declare('rft.ui.List',[_WidgetBase,_TemplatedMixin,_WidgetsInTemplateMixin,_Container],{
    1721            templateString: templateString,
    18             baseClass: 'rftList'
     22            baseClass: 'rftList',
     23            removeCallback: null,
     24            creator: null,
     25
     26            constructor: function() {
     27                lang.mixin(this, arguments);
     28            },
     29
     30            postCreate: function() {
     31                if (this.title) {
     32                    this.titleNode.innerHTML = this.title;
     33                } else {
     34                    this.domNode.removeChild(this.titleNode);
     35                }
     36
     37                this.source = new dojo.dnd.Source(this.sourceNode, {
     38                    isSource: false,
     39                    accept: ["LineListViewItem"],
     40                    horizontal: false,
     41                    withHandles: false,
     42                    selfCopy: false,
     43                    selfAccept: true,
     44                    delay: 0,
     45                    singular: true,
     46                    creator: lang.hitch(this, this.creatorMethod)
     47                })
     48            },
     49
     50            removeItem: function(item, widget) {
     51                widget.destroy();
     52                if(this.removeCallback)
     53                    this.removeCallback(item);
     54            },
     55
     56            insertItem: function(item) {
     57                this.source.insertNodes(false, [item]);
     58            }
     59
    1960        });
    2061    });
Note: See TracChangeset for help on using the changeset viewer.