Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions builder-2d/widgets/MyWidget/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@
"hasStyle": true,
"hasConfig": true,
"hasUIFile": true,
"hasSettingPage": false,
"hasSettingUIFile": false,
"hasSettingLocale": false,
"hasSettingStyle": false,
"hasSettingPage": true,
"hasSettingUIFile": true,
"hasSettingLocale": true,
"hasSettingStyle": true,
"IsController": false
}
}
3 changes: 3 additions & 0 deletions builder-2d/widgets/MyWidget/setting/Setting.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<div>
<label>${nls.configText}</label><input data-dojo-attach-point="textNode">
</div>
41 changes: 41 additions & 0 deletions builder-2d/widgets/MyWidget/setting/Setting.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
// JIMU (WAB) imports:

/// <amd-dependency path="jimu/BaseWidgetSetting" name="BaseWidgetSetting" />
declare var BaseWidgetSetting: any; // there is no ts definition of BaseWidgetSetting (yet!)

// DeclareDecorator - to enable us to export this module with Dojo's "declare()" syntax so WAB can load it:
import declare from "../support/declareDecorator";

// Esri imports:
import esri = require('esri');

interface Config {
demoSetting: string
}
interface Setting {
textNode?: HTMLInputElement
config?: Config
}

@declare(BaseWidgetSetting)
class Setting {
baseClass = 'my-widget-setting';

postCreate(args: any) {
//the config object is passed in
this.setConfig(this.config);
};

setConfig(config: Config) {
this.textNode.value = config.demoSetting;
};

getConfig() {
//WAB will get config object through this method
return {
demoSetting: this.textNode.value
};
};
};

export = Setting;
3 changes: 3 additions & 0 deletions builder-2d/widgets/MyWidget/setting/css/style.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
.jimu-widget-demo-setting input{
margin-left: 10px;
}
7 changes: 7 additions & 0 deletions builder-2d/widgets/MyWidget/setting/nls/strings.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
define({
root: ({
configText: "Set config text:"
})
// add supported locales below:
// , "zh-cn": true
});