|
POST
|
I think I understand why Micheal is having problem, the console is executed before the event is raised. The selectFeatures method is a deffered method. so you need to you something like this. var pPoly;
featureLayer.on("selection-complete", lang.hitch(this,function (result){
pPoly = result.features[0].geometry;
})).then(function(){
console.log(pPoly);
});
... View more
09-02-2015
06:13 AM
|
1
|
0
|
2761
|
|
POST
|
You should probably use CellSelection for this. or use the .dgrid-cell:click and with in the event identify which column the user has clicked and take approriate action. grid.on(".dgrid-header .dgrid-cell:click", function(evt){
var cell = grid.cell(evt);
// cell.element == the element with the dgrid-cell class
// cell.column == the column definition object for the column the cell is within
// cell.row == the same object obtained from grid.row(evt)
});
... View more
09-01-2015
12:36 PM
|
0
|
0
|
2263
|
|
POST
|
Did you check the response data? Like I said earlier, when the JS API get a response which was unexpected, you get this error.
... View more
09-01-2015
05:48 AM
|
0
|
0
|
1294
|
|
POST
|
I dont understand what you are looking for. If getting the current date is the problem then below line should help you. var today = new Date(); var dd = today.getDate(); var mm = today.getMonth()+1; //January is 0! var yyyy = today.getFullYear();
... View more
08-31-2015
10:56 AM
|
0
|
0
|
3645
|
|
POST
|
You need to define what current closure mean, today, this week or this month. and add between clause according.
... View more
08-31-2015
10:27 AM
|
0
|
2
|
3645
|
|
POST
|
I am not really sure what the problem is. But, my best guess is that the service is returning something other than json response, may be a 404 html page which contains the '<' tag. In fiddle, check what response did you get for the request. Also check the service logs, and see if there are any error messages there. Hope this was helpful.
... View more
08-31-2015
06:13 AM
|
0
|
2
|
1294
|
|
POST
|
You could simply set the visiblity of the layer to false, before passing the map to the print task and on print task complete you can turn the layer back on again. Thats what we do in our application.
... View more
08-28-2015
01:19 PM
|
2
|
0
|
2539
|
|
POST
|
I got it to work, there were couple of mistake like the variable label was refering to wrong node, the opened class was applied to wrong node etc. <!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="Content-Type" content= "text/html; charset=utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content= "width=device-width, initial-scale=1.0">
<title>dGrid OnDemandList from QueryTask</title>
<link rel="stylesheet" href="https://js.arcgis.com/3.13/dijit/themes/claro/claro.css"/>
<link rel="stylesheet" type="text/css" href= "//js.arcgis.com/3.13/esri/css/esri.css">
<style type="text/css">
#sidebar {
margin: 10px;
}
.mySelect {
border: 1px solid #b5bcc7;
background-color: #fff;
width: 200px;
height: 17px;
position: relative;
padding: 0;
}
.mySelect .label {
line-height: 17px;
vertical-align: middle;
font-size: 1em;
font-weight: normal;
color: #000000;
white-space:nowrap;
overflow:hidden;
}
.mySelect .arrow {
position: absolute;
top: 0;
right: 0;
background-image: url("//ajax.googleapis.com/ajax/libs/dojo/1.10.3/dijit/themes/claro/form/images/commonFormArrows.png");
background-position: -35px 70%;
background-repeat: no-repeat;
width: 16px;
height: 16px;
border: 1px solid #fff;
border-top: none;
background-color: #efefef;
}
.mySelect .dgrid {
cursor: default;
display: none;
position: absolute;
top: 17px;
left: -1px;
height: 20em;
width: 100%;
}
.mySelect .dgrid-scroller {
position: relative;
}
.opened {
display: block !important;
}
</style>
<script type="text/javascript">
var djConfig = {
parseOnLoad: false,
async: true
};
</script>
<script type="text/javascript" src="//js.arcgis.com/3.13compact">
</script>
<script type="text/javascript">
var pathName = "https://ogitest.oa.mo.gov";
require(['dojo/parser', 'dojo/query', 'dojo/on', 'dojo/dom', 'dojo/dom-class', 'dojo/dom-construct',
'dojo/_base/array', 'esri/tasks/QueryTask', 'esri/tasks/query', "dojo/_base/declare",
'dojo/store/Memory', 'dgrid/OnDemandList', 'dgrid/Selection',
'dojo/domReady!'],
function(parser, query, on, dom, domClass, domConstruct, arrayUtils, QueryTask, Query, declare,
Memory, List, Selection){
parser.parse();
// create list from provider table
function populateProviderList(){
var queryTask = new QueryTask(pathName + '/arcgis/rest/services/DSS/medProvider/MapServer/2');
var queryParams = new Query();
queryParams.outFields = ["*"];
queryParams.where = "1=1";
queryParams.returnGeometry = false;
queryTask.on('complete', providerResultsHandlerGrid);
queryTask.on('error', errorHandler);
queryTask.execute(queryParams);
}
function errorHandler(err){
console.log("error on populate Dropdown, queryTask, error: " + err.details);
}
function providerResultsHandlerGrid(results){
var data = arrayUtils.map(results.featureSet.features, function(feature){
return {
"id": feature.attributes['ID_PROV_TYPE_PK'],
"name": feature.attributes['TX_PROV_DESC'],
"value": feature.attributes['ID_PROV_TYPE_PK']
};
});
var currentMemory = new Memory({
data: data,
idProperty: 'id'
});
dropDown.set('store', currentMemory);
}
var DropDown = declare([ List, Selection ]);
function renderItem(item) {
var divNode = domConstruct.create('div');
domConstruct.place(document.createTextNode(item.name), divNode);
return divNode;
}
var dropDown = new DropDown({
selectionMode: 'single',
renderRow: renderItem
});
domConstruct.place(dropDown.domNode, 'select');
dropDown.startup();
var open = false;
function toggle(state) {
open = typeof state !== 'undefined' ? state : !open;
domClass.toggle(dropDown.domNode, 'opened', open);
}
on(dom.byId('select'), '.button:click', function () {
toggle();
});
var label = query('.label', dom.byId('select'))[0];
dropDown.on('dgrid-select', function (event) {
var node = renderItem(event.rows[0].data);
domConstruct.place(node, label, 'only');
toggle(false);
});
populateProviderList();
});
</script>
</head>
<body class="claro">
<div id="sidebar">
<div id="select" class="mySelect">
<div class="label button">Pick a category</div>
<div class="arrow button"></div>
</div>
</div>
</body>
</html>
... View more
08-28-2015
06:43 AM
|
0
|
0
|
1999
|
|
POST
|
In my personal opinon, we should not use OnDemandGrid as Grid. It could confuse. Its not an issue as long as you are aware. I kind of have a habit of nameing it as name of module, it makes it easier to understand.
... View more
08-27-2015
01:58 PM
|
0
|
0
|
1999
|
|
POST
|
Found the issue, The css style mySelect .dgrid has property display set to none. which makes the items not visible even though they are available. Change the css and it should start showing the items.
... View more
08-27-2015
01:54 PM
|
0
|
0
|
1999
|
|
POST
|
This error usually occurs when the Server where the PrintServices is hosted is not able to access the server/service for the layer. This could be due to various reason, firewall or proxy settings etc. Contact you Network administrator to understand the right reason. Also ensure you are using the correct protocol http/https and the server has been configured for that.
... View more
08-04-2015
07:22 AM
|
0
|
0
|
1112
|
|
POST
|
You seem to be overriding the statup function without calling the this.inherited(arguments) . Try adding it and let me if it works.
... View more
08-03-2015
08:43 AM
|
0
|
1
|
2117
|
|
POST
|
I am not able to understand the requirement clearly. Could you try to explaing with some screen shot/image how you want to display the data. also could you be more specific like you want the same dgrid to display different tables with(out) similar structure. renderRow is kind of main function which is responsible to creating the domNode for the entire row.
... View more
07-28-2015
09:19 AM
|
0
|
1
|
1245
|
|
POST
|
see the example I had added a link. In the below case a custom basemap is created first and then map is initialized with that custom basemap.
require([
"esri/basemaps",
"esri/map",
"dojo/domReady!"
], function (esriBasemaps, Map){
esriBasemaps.delorme = {
baseMapLayers: [{url: "http://services.arcgisonline.com/ArcGIS/rest/services/Specialty/DeLorme_World_Base_Map/MapServer"}
],
thumbnailUrl: "http://servername.fqdn.suffix/images/thumbnail_2014-11-25_61051.png",
title: "Delorme"
};
var map = new Map("ui-map", {
basemap: "delorme",
center: [-111.879655861, 40.571338776], // long, lat
zoom: 13,
sliderStyle: "small"
});
});
again in the above example you can see that the basemap is kind of converted to json string. I was asking you to save that string. I have not seen the behavior you are saying just because you are initializing BasemapGallery, the map should not be affected by it. Can you share the code. Robert Scheitlin, GISP can you please confirm if that is an expected behavior.
... View more
07-24-2015
06:14 PM
|
1
|
3
|
5962
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 03-24-2017 07:15 AM | |
| 1 | 09-13-2016 06:27 AM | |
| 1 | 05-21-2015 08:06 AM | |
| 1 | 12-16-2015 05:43 AM | |
| 1 | 07-20-2015 09:33 AM |
| Online Status |
Offline
|
| Date Last Visited |
05-13-2026
09:55 AM
|