File tree Expand file tree Collapse file tree 5 files changed +58
-4
lines changed
builder-2d/widgets/MyWidget Expand file tree Collapse file tree 5 files changed +58
-4
lines changed Original file line number Diff line number Diff line change 1616 "hasStyle" : true ,
1717 "hasConfig" : true ,
1818 "hasUIFile" : true ,
19- "hasSettingPage" : false ,
20- "hasSettingUIFile" : false ,
21- "hasSettingLocale" : false ,
22- "hasSettingStyle" : false ,
19+ "hasSettingPage" : true ,
20+ "hasSettingUIFile" : true ,
21+ "hasSettingLocale" : true ,
22+ "hasSettingStyle" : true ,
2323 "IsController" : false
2424 }
2525}
Original file line number Diff line number Diff line change 1+ < div >
2+ < label > ${nls.configText}</ label > < input data-dojo-attach-point ="textNode ">
3+ </ div >
Original file line number Diff line number Diff line change 1+ // JIMU (WAB) imports:
2+
3+ /// <amd-dependency path="jimu/BaseWidgetSetting" name="BaseWidgetSetting" />
4+ declare var BaseWidgetSetting : any ; // there is no ts definition of BaseWidgetSetting (yet!)
5+
6+ // DeclareDecorator - to enable us to export this module with Dojo's "declare()" syntax so WAB can load it:
7+ import declare from "../support/declareDecorator" ;
8+
9+ // Esri imports:
10+ import esri = require( 'esri' ) ;
11+
12+ interface Config {
13+ demoSetting : string
14+ }
15+ interface Setting {
16+ textNode ?: HTMLInputElement
17+ config ?: Config
18+ }
19+
20+ @declare ( BaseWidgetSetting )
21+ class Setting {
22+ baseClass = 'my-widget-setting' ;
23+
24+ postCreate ( args : any ) {
25+ //the config object is passed in
26+ this . setConfig ( this . config ) ;
27+ } ;
28+
29+ setConfig ( config : Config ) {
30+ this . textNode . value = config . demoSetting ;
31+ } ;
32+
33+ getConfig ( ) {
34+ //WAB will get config object through this method
35+ return {
36+ demoSetting : this . textNode . value
37+ } ;
38+ } ;
39+ } ;
40+
41+ export = Setting ;
Original file line number Diff line number Diff line change 1+ .jimu-widget-demo-setting input {
2+ margin-left : 10px ;
3+ }
Original file line number Diff line number Diff line change 1+ define ( {
2+ root : ( {
3+ configText : "Set config text:"
4+ } )
5+ // add supported locales below:
6+ // , "zh-cn": true
7+ } ) ;
You can’t perform that action at this time.
0 commit comments