I'm working on creating a widget that will pass settings to the TimeSlider. So, I'm wanting to configure the time extent from one widget and update the time slider extent (settings in image). I'm not sure if I can access those settings or how to do so. Any help would be appreciated. Thx
Solved! Go to Solution.
Brain,
It sounds like you are trying to over think this. From your widget you get a reference to the time slider widget. The widget object has a config property that is an object that is hydrated when the widget actual json file is read. So once you have the reference to the widget.config you just change the values using widget.config.customTimeConfig.startTime.time = x.
Brian,
A widgets settings dialog just changes writes/edits value in that widgets config.json file. So you would just get a reference to the time sliders config and change it's values.
These are the only setting in the config.json file...
{
"showLabels": false,
"autoPlay" : true,
"loopPlay": true,
"timeFormat": "auto"
}
Brain,
The config.json file in the widgets folder is just the template for the real json file that is stored in the app configs/WIDGETNAME/XYZ.json file.
I was able to find the mentioned config file here (to reference for others).
"...\WebAppBuilderForArcGIS-213\server\apps\4\configs\TimeSlider\config_widgets_TimeSlider_Widget_20.json"
So, my question is how do I access/update the json for the the "customTimeConfig.startTime.time" and the "endTime.timeConfig.time" properties through another widget? I'm also using the "_getWidgetConfig" function to open the TimeSlider already, if that helps.
Thanks for all the help.
{
"showLabels": false,
"autoPlay": false,
"loopPlay": false,
"timeFormat": "auto",
"isHonorWebMap": false,
"customLayersConfig": [
{
"id": "[layer]",
"isTimeEnable": true
}
],
"customTimeConfig": {
"keepValueFlag": false,
"startTime": {
"timeConfig": {
"keepValueFlag": false,
"timeMode": "min",
"time": 1567191360000,
"calender": {
"operator": "",
"number": "",
"unit": ""
}
}
},
"endTime": {
"timeConfig": {
"keepValueFlag": false,
"timeMode": "max",
"time": 1568901360000,
"calender": {
"operator": "",
"number": "",
"unit": ""
}
}
},
"interval": {
"number": 2,
"units": "esriTimeUnitsDays"
},
"displayAllData": false
},
"customDateFormat": ""
}
Brain,
It sounds like you are trying to over think this. From your widget you get a reference to the time slider widget. The widget object has a config property that is an object that is hydrated when the widget actual json file is read. So once you have the reference to the widget.config you just change the values using widget.config.customTimeConfig.startTime.time = x.
As usual, you came through again. Thanks for the quick responses and the help on this, it's greatly appreciated.
Is this the reference you are talking about? This was located in the "ConfigureTimeSettings.js".
/*
timeConfigFromat = {
startTime:{
timeConfig: TimeCalendar.config
},
endTime:{
timeConfig: TimeCalendar.config
},
interval:{
number: null //number
units:""//esriTimeInfo.X
}
displayAllData: false//t / f
}
*/
// postCreate: function () {
// this.inherited(arguments);
// },