|
POST
|
Are you making sure the DOM is entirely loaded before adding the map?
... View more
09-26-2013
07:14 AM
|
0
|
0
|
730
|
|
POST
|
Glad you are trying AMD! All of those features you listed should be achievable with the latest version of the JSAPI. Various samples can be found here: https://developers.arcgis.com/en/javascript/jssamples/
... View more
09-26-2013
07:12 AM
|
0
|
0
|
658
|
|
POST
|
I'm sure you saw: http://requirejs.org/docs/dojo.html Which leads to: https://bugs.dojotoolkit.org/ticket/15616 Since the ticket discussed there is resolved, it should be possible. Some great comments further down; they should lead you in the right direction.
... View more
09-26-2013
07:09 AM
|
0
|
0
|
1712
|
|
POST
|
I would just define grid within the context of the require block, rather than at the window (global) level. Basically, just change: window.grid = new (declare([Grid, Selection]))({
// use Infinity so that all data is available in the grid
bufferRows: Infinity,
columns: {
"id": "ID",
"bankName": "Bank Name",
"bankAddres": "Bank Address",
"manager": "Manager Name",
"time": "Opening Time"
}
}, "grid");
to var grid = new (declare([Grid, Selection]))({
// use Infinity so that all data is available in the grid
bufferRows: Infinity,
columns: {
"id": "ID",
"bankName": "Bank Name",
"bankAddres": "Bank Address",
"manager": "Manager Name",
"time": "Opening Time"
}
}, "grid");
You won't be able to access the 'grid' variable outside of your require block, which is why assigning grid to window.grid makes debugging much easier when using FireBug or WebDevToolbars. After making the idProperty change, were you able to select a single row in your grid? Before, the rows remained highlighted, even when selecting a different row. That's the functionality I was targeting; you're really close to getting it all to work now.
... View more
09-25-2013
03:07 PM
|
0
|
0
|
1621
|
|
POST
|
Hey Ganesh! Glad to help. I looked at your code for a few more minutes and you are on the right track. I saw two things you may want to change, though. You may run into trouble with dgrid and select events because your memory store doesn't have a uniqueid set for each feature (or datarow). Change this line: var memStore = new Memory({ data: data }); to this: var memStore = new Memory({ data: data, idProperty: "BankAddres" }); This is assuming all of the BankAddres names will be unique; otherwise, you should have another attribute for each feature that represents a uniqueid. You'll now notice that you can successfully select one row in your grid (but it will not zoom to the feature's extent because that code needs tweaking). Secondly, I see you are calling an event here: grid.on(".field-BankName:click", selectState); I would change that to: grid.on("dgrid-select", function(event){
var rowID = event.rows[0].id; //reference to the selected row.
var rowInMemory = window.grid.store.get(rowID[0].id); //reference to the row in memory
// do feature layer stuff here
}); This gives you more freedom and relieves potential scope issues (I see you've assigned the grid to window.grid; this is very helpful for debugging but not optimal in production environments).
... View more
09-25-2013
02:20 PM
|
0
|
0
|
1621
|
|
POST
|
Jason, thank you so much for your post. I was wondering why this happened and you have made it very clear. +1
... View more
09-25-2013
01:15 PM
|
0
|
0
|
1977
|
|
POST
|
You need to load the InfoTemplate module. require(["esri/InfoTemplate", ... ], function(InfoTemplate, ... ){ ... }); As soon as I put the module into your require block, the dgrid loaded and it looked great!
... View more
09-25-2013
01:07 PM
|
0
|
0
|
1621
|
|
POST
|
The errors thrown are appropriate for when one tries to load two different versions of DOJO. This may or may not be useful: https://developers.arcgis.com/en/javascript/jssamples/mapconfig_customdojo.html
... View more
09-25-2013
12:25 PM
|
0
|
0
|
389
|
|
POST
|
How to use RequireJS with Dojo - http://requirejs.org/docs/dojo.html This led me to: https://bugs.dojotoolkit.org/ticket/15616 Some solutions and suggestions are in the comments. Hope this helps!
... View more
09-25-2013
12:23 PM
|
0
|
0
|
904
|
|
POST
|
I *think* hammer.js uses the RequireJS module loader. From: http://requirejs.org/docs/dojo.html As of Dojo 1.8, Dojo has converted their modules to AMD modules. However, Dojo uses some loader plugins, and the loader plugin APIs are still in draft mode for AMD. So while some modules from Dojo can be used with RequireJS, it will be difficult to use all of Dojo. It is best to use Dojo's AMD loader until ticket 15616 has been resolved. I checked out ticket 15616 from the above quote and it seems there are some potential fixes or suggestions in the comments. Hopefully this helps. I know it is doable with a little more searching. Good luck!
... View more
09-25-2013
12:18 PM
|
0
|
0
|
1131
|
|
POST
|
Hey jsn, Honestly, it depends what kind of functionality you would want to add. Do you have any more specifics and have you checked the source of both websites?
... View more
09-25-2013
12:08 PM
|
0
|
0
|
436
|
|
POST
|
Glad the issue was resolved and thank you for posting your solution. Make sure you mark this thread as 'answered' to help future users of this forum.
... View more
09-25-2013
11:59 AM
|
0
|
0
|
1114
|
|
POST
|
Thanks for posting... looking at it now. CSS looks fine; might actually be the HTML. Content Panes should be inside a BorderContainer, not siblings within the HTML block. Check out this post on how to fix your HTML: http://dojotoolkit.org/reference-guide/1.9/dijit/layout/BorderContainer.html Will look again and see if anything else needs tweaking.
... View more
09-25-2013
09:22 AM
|
0
|
0
|
1389
|
|
POST
|
Trying to help... Can you post your CSS and, if "App2.js" is relevant, that as well? I see some malformed HTML but that wouldn't cause the issues you are having. (http://validator.w3.org/ -> this should help clean up any HTML syntax errors) Also, instead of a dojox datagrid, you should look into using dgrid. It's incredibly flexible, updated frequently and far easier to use than a dojox datagrid (this is my opinion!).
... View more
09-25-2013
09:03 AM
|
0
|
0
|
1389
|
|
POST
|
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:50 AM
|
0
|
0
|
658
|
| 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
|