|
POST
|
Robert, Can I perform some map operations (like set a new extent) in the linked js file, if I add the the BaseWidget module? I added it but it still can't recognize the map object. define(['dojo/_base/declare',
'jimu/BaseWidget','dojo/Evented',
'dojo/on',
'dojo/_base/lang',
'dojo/_base/html',
'esri/request',
'esri/tasks/query',
'esri/tasks/QueryTask',
'esri/tasks/FeatureSet',
'dojo/keys',
'dojo/date/locale'
],
function (declare, BaseWidget, Evented, on, lang, html, esriRequest, Query, QueryTask, FeatureSet, keys, locale) {
return declare([BaseWidget,Evented], {
myfunction: function(){
alert(this.map.id)
}
});
});
... View more
03-15-2017
03:55 PM
|
0
|
1
|
562
|
|
POST
|
Somehow it does not work...It should be simple enough. Widget A define(['dojo/_base/declare', './test', 'jimu/BaseWidget'],
function(declare, test, BaseWidget) {
//To create a widget, you need to derive from BaseWidget.
return declare([BaseWidget], {
// DemoWidget code goes here
//please note that this property is be set by the framework when widget is loaded.
//templateString: template,
baseClass: 'jimu-widget-demo',
postCreate: function() {
this.inherited(arguments);
console.log('postCreate');
},
startup: function() {
this.inherited(arguments);
this.mapIdNode.innerHTML = 'map id:' + this.map.id;
test.myfunction();
//myfunction();
},
});
}); test.js define(['dojo/_base/declare',
'dojo/Evented',
'dojo/on',
'dojo/_base/lang',
'dojo/_base/html',
'esri/request',
'esri/tasks/query',
'esri/tasks/QueryTask',
'esri/tasks/FeatureSet',
'dojo/keys',
'dojo/date/locale'
],
function (declare, Evented, on, lang, html, esriRequest, Query, QueryTask, FeatureSet, keys, locale) {
return declare([Evented], {
// DemoWidget code goes here
//please note that this property is be set by the framework when widget is loaded.
//templateString: template,
myfunction: function(){
alert("Can you see me now?")
}
});
});
... View more
03-14-2017
12:45 PM
|
0
|
4
|
2584
|
|
POST
|
I need to revise my question. I am trying to reach a function that is in another js file (not part of a widget). I'd like to have an external js where a large number of functions will be hosted and any function can be easily called by the js of the widget. As the script shows, one widget accessing a local js. Sorry, I was not clear. define(["dojo/_base/declare",
-------
--------
"./localjs",
--------
---------
],
function (declare,
------
------
localjs,
-------
-------
){
return declare([BaseWidget, _WidgetsInTemplateMixin], {
-------
-------
startup: function () {
-------
-------
localjs.loadSavedSessionsFromFile();
--------
--------
},
------
... View more
03-14-2017
10:23 AM
|
0
|
6
|
2584
|
|
POST
|
Similar to this question, to access, for an example, a function from another module, can I use this setup without using the widgetmanager? If I can, do I call the function correctly? Thanks. Module A: define(["dojo/_base/declare",
-------
--------
"./ModuleB",
--------
---------
],
function (declare,
------
------
ModuleB,
-------
-------
){
return declare([BaseWidget, _WidgetsInTemplateMixin], {
-------
-------
startup: function () {
-------
-------
ModuleB.loadSavedSessionsFromFile();
--------
--------
},
------
... View more
03-14-2017
09:54 AM
|
0
|
8
|
2584
|
|
POST
|
Thank you. I haven't used the widget manager for a while and forgot about it.
... View more
03-11-2017
08:43 AM
|
0
|
1
|
2584
|
|
POST
|
I have a situation that widget A needs to access the config file of widget B. Widget A already has its own config file. I need to compare a field between the two configs from widget A js file. Possible? Thanks.
... View more
03-10-2017
03:11 PM
|
0
|
12
|
3935
|
|
POST
|
I resolved the situation by using: registry.byId(mycheckbox).setValue(false); I don't know why the registry.byId(mycheckbox).set("checked", false) does not work.
... View more
03-10-2017
02:53 PM
|
0
|
0
|
2898
|
|
POST
|
Sorry, I mispoke. The html file is in the form shown below, and in the js file I declare and create the checkboxes in each layerlist. I place each check box on a row in a table, similar to the AddLayer widget. By the way, how can I post code on the forum with the numbering? <div data-dojo-type="dijit/layout/TabContainer" style=" height: 700px; " > <div data-dojo-type="dijit/layout/ContentPane" title="General Environmental" > <div data-dojo-attach-point="layerListGenEnv"> </div> </div> <div data-dojo-type="dijit/layout/TabContainer" title="Biology" nested="true"> <div data-dojo-type="dijit/layout/ContentPane" title="Fish" data-dojo-props="selected:true" style=""> <div data-dojo-attach-point="layerListFish"> </div> </div> <div data-dojo-type="dijit/layout/ContentPane" title="Wildlife"> <div data-dojo-attach-point="layerListWildlife"> </div> </div> <div data-dojo-type="dijit/layout/ContentPane" title="Vegetation"> <div data-dojo-attach-point="layerListVegetation"> </div> </div> </div> --------- --------
... View more
03-07-2017
08:39 AM
|
0
|
2
|
2317
|
|
POST
|
Thanks. My checkboxes are constructed during design time and it seems to be a bit more complex to programmatically check or uncheck the boxes.
... View more
03-07-2017
08:24 AM
|
0
|
4
|
2317
|
|
POST
|
Yes, you are correct. It seems to be too complex to prevent the check. However, I tried this below and it has no effect on the checkbox. The checkbox remains checked after the user clicked on it. The script below is from the function called when the user clicked on the checkbox, however it does not deselect the checkbox. The checkbox id has been assigned the layer name. Console shows false and the layer name meaning that the checkbox is correctly identified. Any obvious errors? Thank you. if (numberoflayers > 4){ alert("Sorry, no more layers than 5 layer can be selected. Please remove a layer before you can add another one.") var thestatus = registry.byId(layer.name); thestatus.set("checked", false); console.log(thestatus.checked + " " + layer.name); return; } else { this.addLayerToMap(layer); }
... View more
03-06-2017
03:48 PM
|
0
|
6
|
2317
|
|
POST
|
Thank you Robert. However it is not to going to work for me. I modified my question because I realized that is not clear enough.
... View more
03-06-2017
02:41 PM
|
0
|
8
|
2317
|
|
POST
|
I have a number of check boxes that users can click on to activate a layer on each checkbox. After a number of check boxes clicked, I would like to capture the click event but not check the checkbox (stop any further actions), and inform the user that the max number of boxes is reached. If the user deselect a checkbox, then the functionality is restored again. Suggestions? Thanks. this.own(on(layerCheckbox.domNode, 'click', lang.hitch(this, function(){ if (numberofcheckboxes >5) //criteria met { -------------- } else { })
... View more
03-06-2017
01:00 PM
|
0
|
10
|
3304
|
|
POST
|
Thanks. I changed the settings in the dijitTab of the override file to get the display I want.
... View more
03-01-2017
02:40 PM
|
0
|
0
|
311
|
|
POST
|
Yes, but why the dojo-override.css is called? How do I prevent it?
... View more
03-01-2017
10:52 AM
|
0
|
2
|
2180
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 06-09-2026 12:44 PM | |
| 1 | 06-08-2026 12:12 PM | |
| 1 | 06-19-2025 10:13 PM | |
| 3 | 02-06-2026 10:44 AM | |
| 1 | 01-08-2026 12:50 PM |
| Online Status |
Offline
|
| Date Last Visited |
2 weeks ago
|