- Timestamp:
- 03/23/12 17:26:55 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
Dev/branches/rest-dojo-ui/client/rft/ui/LineWithActionsWidget.js
r288 r316 1 define(['dojo/_base/declare','dojo/_base/lang','d ijit/form/Button',1 define(['dojo/_base/declare','dojo/_base/lang','dojo/on','dojo/dom','dijit/form/Button', 2 2 'dijit/_WidgetBase','dijit/_TemplatedMixin','dijit/_WidgetsInTemplateMixin', 3 3 'dojo/text!./templates/LineWithActionsWidget.html'], 4 function(declare,lang, Button,_WidgetBase,_TemplatedMixin,_WidgetsInTemplateMixin,templateString){4 function(declare,lang,on,dom,Button,_WidgetBase,_TemplatedMixin,_WidgetsInTemplateMixin,templateString){ 5 5 return declare('rft.ui.LineWithActionsWidget',[_WidgetBase,_TemplatedMixin,_WidgetsInTemplateMixin],{ 6 6 templateString: templateString, 7 baseClass: 'rftLineWithButtons', 7 8 title: '', 8 9 userObject: null, 9 10 actions: {}, 11 postCreate: function() { 12 dom.setSelectable(this.domNode, false); 13 on(this.titleNode,'click',lang.hitch(this,'_onClick')); 14 }, 10 15 startup: function() { 11 16 this.inherited(arguments); … … 17 22 new Button({ 18 23 label: action, 24 //iconClass: 'dijitIconSearch', 25 //showLabel: false, 19 26 onClick: lang.hitch(this,function(){ 20 27 this.actions[action](this.userObject); 21 28 }) 22 }).placeAt(this. actionBar);29 }).placeAt(this.buttonsNode); 23 30 } 24 31 }, 25 32 refresh: function() { 26 33 this.titleNode.innerHTML = this.title; 27 } 34 }, 35 _onClick: function(e){ 36 var preventDefault = this.onClick(e) === false; 37 if(preventDefault){ 38 e.preventDefault(); 39 } 40 return !preventDefault; 41 }, 42 onClick: function(e) {} 28 43 }); 29 44 });
Note: See TracChangeset
for help on using the changeset viewer.