Changeset 374 for Dev/branches/rest-dojo-ui/client/rft/ui/List.js
- Timestamp:
- 07/24/12 16:39:41 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
Dev/branches/rest-dojo-ui/client/rft/ui/List.js
r364 r374 1 1 define([ 2 2 'dojo/_base/declare', 3 'dojo/_base/lang', 3 4 'dijit/_WidgetBase', 4 5 'dijit/_TemplatedMixin', 5 6 'dijit/_WidgetsInTemplateMixin', 6 7 'dijit/_Container', 8 'rft/ui/LineWithActionsWidget', 7 9 'dojo/text!./templates/List.html' 8 10 ],function( 9 11 declare, 12 lang, 10 13 _WidgetBase, 11 14 _TemplatedMixin, 12 15 _WidgetsInTemplateMixin, 13 16 _Container, 17 LineWithActionsWidget, 14 18 templateString 15 19 ){ 16 20 return declare('rft.ui.List',[_WidgetBase,_TemplatedMixin,_WidgetsInTemplateMixin,_Container],{ 17 21 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 19 60 }); 20 61 });
Note: See TracChangeset
for help on using the changeset viewer.