|
POST
|
Hi jsn, This link should help explain the whys and hows of using AMD. http://dojotoolkit.org/blog/learn-more-about-amd *edit I noticed you were looking for older samples in another thread and felt my response should have probably been posted in this thread. Hey jsn, It's a great time to start learning and using AMD syntax because DOJO 2.0 will soon be released and the legacy syntax will no longer be supported in newer versions of the API. I think AMD style ends up making the code much more clean and readable from a programmer's perspective (not to mention, faster apps!) I noticed that you are using version 1.6 of the JSAPI, from the other thread. That version was released in February 2010. Since then, many improvements and features have been added. You should check them out! They are fantastic.
... View more
09-25-2013
08:39 AM
|
0
|
0
|
1127
|
|
POST
|
This is the file that ChinhSch attached: <!DOCTYPE html> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <meta http-equiv="X-UA-Compatible" content="IE=7, IE=9, IE=10" /> <meta name="viewport" content="initial-scale=1, maximum-scale=1, user-scalable=no"> <title>Drag Test</title> <link rel="stylesheet" href="http://js.arcgis.com/3.6/js/esri/css/esri.css"> <style> html, body { height: 100%; width: 100%; margin: 0;} </style> <script type="text/javascript">var djConfig = {parseOnLoad: true};</script> <script type="text/javascript" src="http://serverapi.arcgisonline.com/jsapi/arcgis/?v=3.5"></script> <script type="text/javascript"> dojo.require("dijit.layout.BorderContainer"); dojo.require("dijit.layout.ContentPane"); dojo.require("esri.map"); dojo.addOnLoad(init); var map; function init() { map = new esri.Map("map"); map.on("mouse-up", up);//Ok with IE Chrome firefox... map.on("mouse-drag", drag);//Ok with Chrome//IE no console.log appear? //Same problem with mouse-move } //////////////////////////////////////////////////////////////////////////////// // TEST function drag() { console.log("drag"); } function up() { console.log("up"); } </script> </head> <body class="claro"> <div id="content" dojotype="dijit.layout.BorderContainer" style="width: 100%; height: 100%; margin: 0;"> <div id="middlePane" dojotype="dijit.layout.BorderContainer" region ="center"> <div id="map" dojotype="dijit.layout.ContentPane" region="center"></div> </div> </div> </body> </html> The map wasn't showing up and the code was a bit messy so I cleaned up it ( and AMDified it ). <!DOCTYPE html> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <meta http-equiv="X-UA-Compatible" content="IE=7, IE=9, IE=10" /> <meta name="viewport" content="initial-scale=1, maximum-scale=1, user-scalable=no"> <title>Drag Test</title> <link rel="stylesheet" href="http://js.arcgis.com/3.6/js/esri/css/esri.css"> <style> html, body ,#map{ height: 100%; width: 100%; margin: 0;} </style> <script type="text/javascript" src="http://serverapi.arcgisonline.com/jsapi/arcgis/?v=3.5"></script> <script type="text/javascript"> require([ "esri/map", "dojo/ready", "dojo/on", ], function (Map, ready, on) { ready(function () { var map = new Map("map", { center: [-56.049, 38.485], //longitude, latitude zoom: 3, basemap: "streets" }); map.on("mouse-up", up);//Ok with IE Chrome firefox... map.on("mouse-drag", drag);//Ok with Chrome//IE no console.log appear? //Same problem with mouse-move function drag() { console.log("drag"); } function up() { console.log("up"); } }); }); </script> </head> <body class="claro"> <div id="content" dojotype="dijit.layout.BorderContainer" style="width: 100%; height: 100%; margin: 0;"> <div id="map" dojotype="dijit.layout.ContentPane" region="center"></div> </div> </body> </html> I was able to successfully fire drag events in IE9 (but not IE8 or IE10). Using: map.on("mouse-drag-start", drag); map.on("mouse-drag-end", drag);
... View more
09-23-2013
08:17 AM
|
0
|
0
|
1291
|
|
POST
|
Have you tried moving your require block to outside a function (on the script level) and writing functions within the require block?
... View more
09-19-2013
02:47 PM
|
0
|
0
|
430
|
|
POST
|
VinayBa, it would be extremely helpful for other users if you would go back and mark your previously created threads as answered when an answer has been provided. You've created thirty different threads, and all of them are currently marked as open: http://forums.arcgis.com/search.php?searchid=1736844 It would also be helpful to post how you went about fixing your problem(s) so future users who search the forums can find them. Thank you!
... View more
09-17-2013
07:37 AM
|
0
|
0
|
760
|
|
POST
|
Hi Vinay! It looks like you've been extremely busy lately. Don't forget to mark other threads as 'answered' when you've gotten a satisfactory reply 🙂
... View more
09-12-2013
08:17 AM
|
0
|
0
|
1222
|
|
POST
|
i want to use latest dojo 1.9 I actually want o use DOJO 1.7 I am confused... Is there a specific technical reason that makes Dojo 1.8 unattractive for use? You haven't posted any technical details. If you need to use 1.7, you could probably use an older version of the Esri JSAPI that uses Dojo 1.7 More details here: https://developers.arcgis.com/en/javascript/jshelp/new_v32.html
... View more
09-05-2013
08:01 AM
|
0
|
0
|
877
|
|
POST
|
Thanks zj_zou and Jeff, since I have 8 sets of parameters, I'll end up with 8 event handlers David While you could have eight event handlers, you could probably get away with one event handler for all checkbox elements (assuming all checkbox elements on the page have the same functionality with different params to pass). You could identify the parameters depending on which checkbox was clicked, inside the single event handler, then pass that along to your update function.
... View more
09-05-2013
07:55 AM
|
0
|
0
|
2339
|
|
POST
|
Thank you for the responses. They are a help. What I'm trying to do is to pass arguments into a function from various checkboxes (each with their own set of arguments), Is there a way to do that using AMD? Just to explain the situation a bit more: <script> require ({..... function X (takes arguments a, b) )}; <html section> checkbox 1 -----function X (argument1a , argument 1b) checkbox 2 ------ function X (argument2a, argument 2b) David Yes, Jeff explained how to connect an event in the post above yours (copied below): What you need to do Inside the require function call dojo/on to connect the checkbox to the event handler function. (If you don't need to deal with legacy browsers you should use the built in JavaScript addEventListener function instead of dojo/on.) Check out the 'dojo/on' documentation for a bit; you should be able to find everything you need.
... View more
09-04-2013
02:10 PM
|
0
|
0
|
2339
|
|
POST
|
Hi Andy! From the information you've posted, this should be doable. Have you checked out the API for tutorials or samples? Do you have any code you can share?
... View more
09-04-2013
02:04 PM
|
0
|
0
|
499
|
|
POST
|
I dont want to use dojo given by Esri for no Esri related stuffs i have to develop lot of Rich UI where i want to use latest dojo 1.9 so i want to load custom dojo .I found a link http://resources.esri.com/help/9.3/arcgisserver/apis/javascript/arcgis/help/jssamples_start.htm#jssamples/mapconfig_customdojo.html which described to process with <script src="http://js.arcgis.com/3.6/"></script> i am not able to load custom dojo.Please let me know what could be done. As sunilpalkar asked, is there a specific reason you need to use Dojo 1.9 over 1.8? I am aware of many mobile enhancements in the new Dojo version but unless there is a specific reason that you need Dojo 1.9, you should be able to use the Esri JSAPI with no problem.
... View more
09-04-2013
07:56 AM
|
0
|
0
|
877
|
|
POST
|
Glad you fixed your issue! Don't forget to mark this thread as 'answered' if you no longer seek assistance.
... View more
09-04-2013
07:52 AM
|
0
|
0
|
403
|
|
POST
|
Thanks for the heads up! Looks like the documentation is there, but hidden with styling. In the meantime, if you want to see the specific Event Details, you can use a web-developer extension (such as firebug) and remove the class 'hidden' from the following two divs: evtSwitchDetail, connectEventsDetail You should be able to see the event details after doing this.
... View more
09-04-2013
07:49 AM
|
0
|
0
|
300
|
|
POST
|
I believe it has to do with the parser, or rather, when the parser is called. You could call the parser manually instead of onLoad, then load the map.
... View more
08-14-2013
10:24 AM
|
0
|
0
|
633
|
|
POST
|
Endre, cmacias mentioned both that thread and the jsfiddle example in the first post of this thread, saying that he already tried to follow that example and it did not work. Are you still having problems, cmacias?
... View more
08-02-2013
08:48 AM
|
0
|
0
|
1464
|
|
POST
|
Even though you've marked this thread as answered, I'm not sure you've fixed your dgrid header issue. https://github.com/SitePen/dgrid/issues/285#issuecomment-8655324 https://github.com/SitePen/dgrid/issues/249 What it comes down to is you are probably starting up your grid(s) at the wrong time (usually too early). You could start them up after manually calling the parser. Something like:
require([ "dojo/ready","dojo/parser"], function (ready, parser){
// Other Code
parser.parse();
ready(function (){
// dataStore = new Memory ({data});
yourGrid.set("store", dataStore );
yourGrid.startup();
// Other Code
});
});
There are other valid options listed in the two threads I linked above.
... View more
07-30-2013
09:50 AM
|
0
|
0
|
2173
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 08-26-2014 09:56 AM | |
| 1 | 09-18-2014 11:50 AM | |
| 1 | 09-19-2014 11:28 AM | |
| 1 | 07-09-2014 01:43 PM | |
| 1 | 07-09-2014 02:05 PM |
| Online Status |
Offline
|
| Date Last Visited |
08-14-2024
05:31 PM
|