Draw widget custom list reverting to esri default once published

820
1
Jump to solution
04-12-2021 12:27 PM
Labels (1)
abureaux
MVP Regular Contributor

Hello,

I am having some trouble with the Draw/eDraw widgets. I added some custom images (rough details below):

  • \jimu.js\dijit\SymbolsInfo - added a custom *.json with my data
  • \jimu.js\dijit\SymbolChooser.js - changed _isOnline to false, and changed DEFAULT_PORTAL_URL to my portal
  • \jimu.js\dijit\templates\SymbolChooser.html - Referenced my custom *.json and marked it as "selected"

Everything works perfectly in the WAB. Once I export this app from the WAB, toss it into wwwroot, and register it in portal, the Draw/eDraw widget reverts back to esri defaults...

All of my apps and customizations (including Draw/eDraw) are there and work correctly. But when I click on "point" within the Draw/eDraw widget, the drop-down contains all the esri default items.

Has anyone experienced this or have a solution?

0 Kudos
1 Solution

Accepted Solutions
abureaux
MVP Regular Contributor

I've been able to get this working. Disclaimer: Likely not the most elegant solution.

After some testing, the problem was clearly that once published, the Draw app was pulling the list for points from an outside source. I had hoped that setting isOnline to false would work, but it had no effect.

What I ended up doing was commenting out a block of code in the SymbolChooser.js that was calling this outside list. See below:

if(!this._symbolTypes){
// // fetch symbol types from portal
// this._initPortal()
//Added this line:
this._offLineGetSymbols(fileName);
// .then(lang.hitch(this, this._fetchSymbolTypes))
// .then(lang.hitch(this, function(types){
// if(!this.domNode){
// return;
// }
// // create options
// this._clearOptions();
// this._createOptions(types);
// // fetch symbols from portal
// this._handleGetPointSymbols(lang.hitch(this, this._getPortalSymbolsByType), fileName);
// }), lang.hitch(this, function(err){
// if(!this.domNode){
// return;
// }
// if(window.isXT){
// this._offLineGetSymbols(fileName);
// }else{
// this.loadingShelter.hide();
// console.error('Fetching symbols failed', err);
// }
// }));

}else{
// // fetch symbols from portal
this._handleGetPointSymbols(lang.hitch(this, this._getPortalSymbolsByType), fileName);
}

},

 

View solution in original post

0 Kudos
1 Reply
abureaux
MVP Regular Contributor

I've been able to get this working. Disclaimer: Likely not the most elegant solution.

After some testing, the problem was clearly that once published, the Draw app was pulling the list for points from an outside source. I had hoped that setting isOnline to false would work, but it had no effect.

What I ended up doing was commenting out a block of code in the SymbolChooser.js that was calling this outside list. See below:

if(!this._symbolTypes){
// // fetch symbol types from portal
// this._initPortal()
//Added this line:
this._offLineGetSymbols(fileName);
// .then(lang.hitch(this, this._fetchSymbolTypes))
// .then(lang.hitch(this, function(types){
// if(!this.domNode){
// return;
// }
// // create options
// this._clearOptions();
// this._createOptions(types);
// // fetch symbols from portal
// this._handleGetPointSymbols(lang.hitch(this, this._getPortalSymbolsByType), fileName);
// }), lang.hitch(this, function(err){
// if(!this.domNode){
// return;
// }
// if(window.isXT){
// this._offLineGetSymbols(fileName);
// }else{
// this.loadingShelter.hide();
// console.error('Fetching symbols failed', err);
// }
// }));

}else{
// // fetch symbols from portal
this._handleGetPointSymbols(lang.hitch(this, this._getPortalSymbolsByType), fileName);
}

},

 

0 Kudos