Is there anybody out there with tips or samples for updating WAB config.json file?
More specifically adding a widget through Javascript.
I am trying to read in the json, find where i need to add, and update the json file.
I know how to just open and manually adding the widget.
Robert Scheitlin, GISP ---hoping you have some tips.
DevelopersWeb AppBuilder Custom Widgets
Solved! Go to Solution.
I have some links to tips /blogs/myAlaskaGIS/2017/02/15/web-appbuilder-tips-and-links-for-creating-modifying-and-modifying-cus...
that and several other WAB developer edition blogs can be found /blogs/myAlaskaGIS/2016/03/09/web-appbuilder-developer-edition-customization-resource-list?sr=search...
I have some links to tips /blogs/myAlaskaGIS/2017/02/15/web-appbuilder-tips-and-links-for-creating-modifying-and-modifying-cus...
that and several other WAB developer edition blogs can be found /blogs/myAlaskaGIS/2016/03/09/web-appbuilder-developer-edition-customization-resource-list?sr=search...
Thanks Rebecca, I will give these a look over.
Todd,
I am a little confused by your goal here. Why are you wanting to update the main config.json manually. Why not use the WAB UI for that?
I have some grunt tasks that run to create the widgets, and what is missing is adding it into the application. I was hoping to just add another task that reads the json, prompts the Developer for position of the widget, and updates and saves out the file.
I have been tasked to work out a dev workflow. We would like to keep the builder out of the flow as much as possible.
Todd,
I have never attempted anything like that but the main config.json is just a basic json/text file so if you grunt task and read and write and parse the json then you should have no problem.
Yeah that was the thought, but then i started getting in the weeds, and then they started to grow higher. Just not a JSON master. But i am sure i am just over thinking it.
Todd,
You probably are. Json is pretty simple text and the widgets are just part of a arrays like
"widgetsOnScreen" : {
"widgets": [
{
"position" : {
"left" : 105,
"top" : 45,
"relative" : "map"
},
"id" : "_6",
"name" : "Query",
"version" : "2.4",
"uri" : "widgets/Query/widget",
"config" : "configs/Query/config_Query widget.json",
"icon" : "widgets/Query/images/icon.png"
},
Thanks, Robert Schmidley and rastrauch ---- It is a bit more complicated than I thought for the timeframe I have and would better serve to just wait on it.
On another objective; would you suggest a best practice when altering the WAB structure (regarding CSS on Theme based Elements) to place these style updates in a separate CSS file and just @import or load this in separate. Or just tack them on to already existing CSS files where the original exists. ???
Todd, if you haven't already done so, you may want to repost your new question in Web AppBuilder Custom Themes or at least repost and then tag that group.