|
POST
|
Just to be sure, does this return the values that the user selects or the entered values?
... View more
05-07-2015
02:00 PM
|
0
|
0
|
1914
|
|
POST
|
I was looking at this post by Kelly Hutchins a programmatic way to populate a combo box. I have this web service: Layer: Sign (ID: 0) and I want to populate the items from the MUTCD field; there are over 257 items in the list. How would I change this code to work as AMD and what required statements do I need; I also want the first value to be "" and display as Select One : function init() {
queryTask = new esri.tasks.QueryTask
("http://sampleserver1.arcgisonline.com/ArcGIS/rest/services/Louisville/LOJIC_LandRecords_Louisville/MapServer/2");
query = new esri.tasks.Query();
query.returnGeometry = false;
query.outFields = ["ZONING_TYPE"];
query.where = "ZONING_TYPE<> ''";
queryTask.execute(query,populateList);
} function populateList(results) {
//Populate the ComboBox with unique values
var zone;
var values = [];
var testVals={};
//Add option to display all zoning types to the ComboBox
values.push({name:"ALL"})
//Loop through the QueryTask results and populate an array
//with the unique values
var features = results.features;
dojo.forEach (features, function(feature) {
zone = feature.attributes.ZONING_TYPE;
if (!testVals[zone]) {
testVals[zone] = true;
values.push({name:zone});
}
});
//Create a ItemFileReadStore and use it for the
//ComboBox's data source
var dataItems = {
identifier: 'name',
label: 'name',
items: values
};
var store = new dojo.data.ItemFileReadStore({data:dataItems});
dijit.byId("mySelect").store = store;
}
dojo.addOnLoad(init);
... View more
05-06-2015
02:28 PM
|
1
|
5
|
4940
|
|
POST
|
I believe this will involve the query task. I have code that will provide me information on street supports: var supportId, type, address;
app.supportLayer.on("click", function (evt) {
supportId = evt.graphic.attributes.SUPPORTID;
type = evt.graphic.attributes.TYPE;
address = evt.graphic.attributes.ADDRESS;
app.attributesModal.modal("show");
document.getElementById("address").value = address;
console.log(supportId);
console.log(type);
console.log(address);
}); This feature layer is: http://maps.decaturil.gov/arcgis/rest/services/test/StreetSignTest/FeatureServer/1 It has a unique SUPPORTID. The layer of sign that I want to get records from is: http://maps.decaturil.gov/arcgis/rest/services/test/StreetSignTest/FeatureServer/0 In this table, the related field is SUPPORTID An example of what I have is I want to search for the value of SUPPORTID and get all records that match the SUPPORTID in the streetSigns layer. I have four street signs with a supportId of 1903. How would I query those four street signs and then display one at a time based on a key push, so I could see one record at a time?
... View more
05-05-2015
02:37 PM
|
1
|
1
|
3726
|
|
POST
|
I could possibly hide the grid and then get the value of the element of the grid. It looks some identifies place multiple rows as the identified location. Still need to navigate between layers or in that case tabs. Are you able to get values from an individual cell?
... View more
05-05-2015
01:49 PM
|
2
|
0
|
1865
|
|
POST
|
I've had something like that for another app, but I need to populate a form for field use and data entry on a mobile device.
... View more
05-05-2015
01:43 PM
|
0
|
0
|
1865
|
|
POST
|
We have sign supports and street sign layers. Sometimes the layers will be stacked and the elements will be too. What do I need to do to navigate through the layers and the elements of the layer that are located at the exact same location? Here is what I have to evaluate an individual element from the street supports layer: var supportId, type, address;
app.supportLayer.on("click", function (evt) {
supportId = evt.graphic.attributes.SUPPORTID;
type = evt.graphic.attributes.TYPE;
address = evt.graphic.attributes.ADDRESS;
app.attributesModal.modal("show");
document.getElementById("address").value = address;
console.log(supportId);
console.log(type);
console.log(address);
}); Here is an editor widget that does the same thing. I had to make a larger form for mobile devices:
... View more
05-05-2015
12:48 PM
|
1
|
5
|
5376
|
|
POST
|
This is what ended up working: on(dom.byId("btnCancelFeedback"), "click", function () {
query("#feedbackModal").modal("hide");
}); The other thing that worked is when I changed removed the double quotes from feedbackModal and replaced them with single quotes.
... View more
05-05-2015
08:55 AM
|
1
|
0
|
752
|
|
POST
|
When I add the following block of code: on(dom.byId("btnCancelFeedback"), "click", function () {
document.getElementById("feedbackModal").style.visibility = 'hidden';
}); I receive an error as follows: TypeError: Cannot read property 'on' of null "in domReady callback" "TypeError: Cannot read property 'on' of null I have used this method in the past with no issues including inside this project, but this causes an error. Any ideas? Here is my complete app on github:https://github.com/csergent45/streetSigns The JavaScript is in app/main.js
... View more
05-05-2015
07:20 AM
|
1
|
1
|
3577
|
|
POST
|
Very nice. So this is setting visibility based on the value of checked. Is that correct?
... View more
05-05-2015
06:47 AM
|
0
|
1
|
2933
|
|
POST
|
I appreciate everyone's help. Thanks to everyone for your help. I clicked like and helpful to give you all points. Here is the final code that I came up with: on(dom.byId("lyrSigns"), "change", updateSignLayerVisibility);
on(dom.byId("lyrSupports"), "change", updateSupportLayerVisibility);
function updateSignLayerVisibility() {
if (document.getElementById('lyrSigns').checked) {
app.signLayer.setVisibility(true);
} else {
app.signLayer.setVisibility(false);
}
}
function updateSupportLayerVisibility() {
if (document.getElementById('lyrSupports').checked) {
app.supportLayer.setVisibility(true);
} else {
app.supportLayer.setVisibility(false);
}
} I was hoping for a single loop, but this works.
... View more
05-05-2015
06:17 AM
|
0
|
7
|
2933
|
|
POST
|
I have updated it as follows and there are no errors, but nothing is happening: var visibleLayerIds = [];
on(dom.byId("lyrSigns"), "change", updateLayerVisibility);
//on(dom.byId("lyrSupports"), "change", updateLayerVisibility);
function updateLayerVisibility() {
var inputs = query(".list_item");
var inputCount = inputs.length;
visibleLayerIds = [0];
for (var i = 0; i < inputCount; i++) {
if (inputs.checked) {
visibleLayerIds.push(inputs.value);
}
}
if (visibleLayerIds.length === 0) {
visibleLayerIds.push(-1);
}
app.signLayer.setVisibility(visibleLayerIds);
} But app.signLayer does define as my sign layer.
... View more
05-04-2015
01:48 PM
|
0
|
9
|
3385
|
|
POST
|
I tried Gregg Roemhildt 's solution by entering the following: var visibleLayerIds = []; on(dom.byId("lyrSigns"), "change", updateLayerVisibility);
//on(dom.byId("lyrSupports"), "change", updateLayerVisibility);
function updateLayerVisibility() {
var inputs = query(".list_item");
var inputCount = inputs.length;
visibleLayerIds = [0];
for (var i = 0; i < inputCount; i++) {
if (inputs.checked) {
visibleLayerIds.push(inputs.value);
}
}
if (visibleLayerIds.length === 0) {
visibleLayerIds.push(-1);
}
signLayerUrl.setVisibleLayers(visibleLayerIds);
} I have been referencing this sample: https://developers.arcgis.com/javascript/jssamples/map_explicitlayerlist.html And I wondered, since I am working with two separate feature layers, do I need to work with them individually as the example just uses a single dynamic layer. Either way, when I update the code from above I get the following error: ncaught ReferenceError: signLayerUrl is not defined But it's defined in the config section of the page. I have updated my code with this modification on github: https://github.com/csergent45/streetSigns
... View more
05-04-2015
12:55 PM
|
0
|
13
|
3385
|
|
POST
|
I modified the code as follows: var checkBox = new CheckBox({
name: "lyrSigns",
value: "agreed",
checked: false,
onChange: function (b) {
if (b == true) {
app.map.addLayer("signLayerUrl");
} else {
app.map.removeLayer("signLayerUrl");
}
}
}, "lyrSigns").startup(); And I get the following error: Uncaught lang.hitch: scope["onLoad"] is null (scope="[object Window]")
... View more
05-04-2015
09:30 AM
|
0
|
1
|
1307
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 02-26-2015 12:31 PM | |
| 1 | 06-24-2015 06:06 AM | |
| 1 | 07-15-2015 12:34 PM | |
| 1 | 05-21-2015 02:27 PM | |
| 1 | 05-19-2015 11:52 AM |
| Online Status |
Offline
|
| Date Last Visited |
11-11-2020
02:23 AM
|