|
POST
|
Maybe I need to also set the filteringSelect as a pausable event? I'd like to be able to reset the list back to the prompt 'Select a district' without firing the change event.
... View more
04-03-2015
08:01 AM
|
0
|
0
|
1507
|
|
POST
|
Have you tried loading it as a FeatureLayer in MODE_SELECTION, just for the events and again as as ArcGISTileMapServiceLayer for the displayed? It seems like I've rigged around a project before where I had performance issues. Also the help under Reference Feature Layer Best Practices | Guide | ArcGIS API for JavaScript described tips for performance on FeatureLayers. I haven't found the magic number yet, but setting a different maxAllowableOffset might help.
... View more
04-03-2015
07:55 AM
|
1
|
0
|
2650
|
|
POST
|
There was a little issue with the style that Kelly sent, one of the widths on the select style was too wide, completely covering up the dropdown arrow. Otherwise it works for me and also in the emulators I tried. I don't expect much mobile use of this particular map, the subject matter is pretty obscure.
... View more
03-25-2015
02:09 PM
|
0
|
0
|
2892
|
|
POST
|
Kelly, Is there somewhere else you could post the example you made? I'm just now getting back to this, and your link is getting blocked by our cybersecurity. When I contacted our security team, asking to have it unblocked, I was told 'no', since all personal network storage requests are routinely blocked.
... View more
03-25-2015
07:14 AM
|
0
|
1
|
2892
|
|
POST
|
That's it, after I switch =+ to +=. Now I need to figure out how to programmatically uncheck all the boxes with my 'Clear' button.
... View more
03-23-2015
09:25 AM
|
0
|
0
|
3634
|
|
POST
|
I realized after I looked at the data more closely that a simple Hosp_Type = 'some value' isn't going to work. In my actual data, not just this basic sample, the data column allows there to be multiple values, not just one in that column. In those instances where there is only one specified, 'equal to' works fine, But I'm just as likely to have a type of 'orthopedic, neurologic' or 'mental health w/ IQ test, mental health w Weschler'. The user wants to check as many boxes as they want. At least I'm only searching within this one 'type' column and not all. I'm thinking I'll need a function to generate a long where clause instead, although I don't have the syntax right yet. I"m also not sure this is going to work for my definition expression of my feature layer. function executeQuery(){ searchList.sort(); var searchClause = createWhereClause(searchList); searchQuery.where = searchClause; qTask.execute(searchQuery, updateGridHandler); pointLayer.setDefinitionExpression(searchClause); } function createWhereClause (sortedString){ var whereSnippet = "Hosp_Type LIKE '%"; var whereClause = ""; for (var i = 0, len = sortedString.length; i < len; ++i) { if (i < sortedString.length -1){ //this part isn't right yet!! whereClause =+ whereSnippet + sortedString + "%' OR " } else { whereClause =+ whereSnippet + sortedString + "%'"; } } return whereClause; } This is public facing. I've been told this isn't sensitive, since it's provider information, not patient data. Medical Review Team Provider Search
... View more
03-23-2015
08:53 AM
|
0
|
2
|
3634
|
|
POST
|
I was able to get this figured out, as far as the checkbox tree is concerned. I used Chris's suggestion of the Dojo Dijit Tree with Checkboxes. Once I downloaded and referenced it in my code, I was able to use the check box events to populate my query. The problem I have now is my logic of using a where clause IN doesn't work like I'd thought. What I really need is a function that creates a big concatenated OR statement. The way I have it now, it only finds the records that exactly matching the values, when what I really wanted was any record that contained that value. At least I'm getting the values from the checkboxes, which was my original posting. <!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" />
<meta name="viewport" content="initial-scale=1, maximum-scale=1,user-scalable=no"/>
<title>CheckBox Tree Example</title>
<link rel="stylesheet" href="https://js.arcgis.com/3.11/dijit/themes/claro/claro.css"/>
<link rel="stylesheet" href="cbtree/themes/claro/claro.css"/>
<script type="text/javascript">
var dojoConfig = {
parseOnLoad: false,
async:true,
packages: [{
"name": "cbtree",
"location": location.pathname.replace(/\/[^/]+$/, "")+'/cbtree'
}]
};
</script>
<script type="text/javascript" src="https://js.arcgis.com/3.11/"></script>
<script type="text/javascript">
var popup, map, geocoder, layer, template, symbol;
var searchList = [];
var pathName = "https://ogitest.oa.mo.gov";
require([
"dojo/parser","dojo/dom-style", "dojo/dom-construct","esri/dijit/Popup","dojo/store/Memory",
"dojo/store/Observable","cbtree/Tree", "cbtree/store/ObjectStore", "cbtree/model/ForestStoreModel",
"cbtree/extensions/TreeStyling",
"esri/map", "esri/layers/GraphicsLayer",
"esri/symbols/PictureMarkerSymbol","esri/symbols/SimpleMarkerSymbol","esri/symbols/SimpleLineSymbol",
"esri/InfoTemplate","esri/tasks/query","esri/tasks/QueryTask",
"dojo/_base/Color", "dojo/dom","dojo/on","dijit/registry", "dojo/_base/array",
"dijit/layout/BorderContainer","dijit/layout/TabContainer","dijit/layout/ContentPane","dijit/form/Button",
"dijit/TitlePane", "dojo/domReady!" ], function (
parser,domStyle,domConstruct, Popup, Memory, Observable,Tree, ObjectStore, StoreModel,
TreeStyling, Map,GraphicsLayer,PictureMarkerSymbol, SimpleMarkerSymbol,
SimpleLineSymbol,InfoTemplate,Query,QueryTask, Color, dom,on, registry, arrayUtils) {
parser.parse();
var qTask = new QueryTask(pathName+"/arcgis/rest/services/DHSS/medicalFacility/MapServer/0");
var searchQuery = new Query();
// searchQuery.outSpatialReference = spatialReference;
searchQuery.returnGeometry = false;
searchQuery.outFields = ["Facility", "Address", "City","Hosp_Type", "OBJECTID"];//fields you want in your grid
var data = [
{ id: "CA", name:"Critical Access", type:"parent"},
{ id: "GA", name:"General Acute Care", type:"parent"},
{ id: "LT", name:"Long Term Care", type:"parent" },
{ id: "PSY", name:"Psychiatric", type:"parent" },
{ id: "REH", name:"Rehabilitation", type:"parent" },
{ id: "VA", name:"Veterans", type:"parent"},
{ id: "OT", name:"Other", type:"parent"}
];
var store = new Memory( { data: data });
var model = new StoreModel( { store: store,
rootLabel: "Specialty Type",
showRoot:false,
query: {type: 'parent'},
});
tree = new Tree( {
model: model,
id: "tree02",
branchReadOnly: false,
branchcheckBox:true,
branchIcons: false,
nodeIcons: false,
leafIcons:false,
rootNode:false
}, "CheckboxTree" );
tree.startup();
// Establish listener and start the tree.
function checkBoxClicked( item, nodeWidget, evt ) {
var newState = nodeWidget.get("checked" );
var label = this.model.getLabel(item);
if( newState ) {
searchList.push(label);
// tree.set("iconStyle", {border:"solid"}, item );
// tree.set("labelStyle",{color:"red"}, item );
} else {
var index = array.indexOf(label);
if (index > -1) {
searchList.splice(index, 1);
}
}
}
function executeQuery(){
searchList.sort();
var sortedList = sortAndRemoveDuplicates(searchList);
var sortedString = sortedList.join("','");
var whereClause = "HOSP_TYPE IN ('" + sortedString + "')";
console.log("whereClause = " + whereClause);
searchQuery.where = whereClause;
qTask.execute(searchQuery,queryHandler);
}
function queryHandler(results){
console.log("in queryHandler");
}
function sortAndRemoveDuplicates(arr) {
arr.sort( function(a, b) { return a - b; } );
var copy = arr.slice(0);
arr.length = 0;
for (var i = 0, len = copy.length; i < len; ++i) {
if (i == 0 || copy != copy[i - 1]) {
arr.push(copy);
}
}
return arr;
}
//event listeners
tree.on( "checkBoxClick", checkBoxClicked );
registry.byId('btnSearch').on('click', function(evt){
// searchList.length = 0;
executeQuery();
});
});
</script>
</head>
<body class="claro">
<h1 class="DemoTitle">The CheckBox Tree with Multi State CheckBoxes</h1>
<p>
A basic CheckBox Tree using a dojo/store Memory store (non-observable).
</p>
<div id="CheckboxTree">
</div>
<button id="btnSearch" data-dojo-type="dijit/form/Button">Search</button>
<div id="gridDiv"></div>
</body>
</html>
... View more
03-23-2015
08:07 AM
|
1
|
4
|
3634
|
|
POST
|
In the Reference for Geocoder, the definition for the zoomScale property is Scale to zoom to when geocoder does not return an extent. The geocoder will create an extent based on the scale supplied and the geometry returned. All I'm trying to do is not have the geocoder zoomed in so tight. It seems like any time you enter an address, you are getting an extent, even though the result is a point feature. I tried altering the zoomScale to something larger like 500000, but it doesn't do anything. I assume this is because the geocoder IS returning an extent, even though it's just a tiny one around the point. Under what situations is it NOT returning an extent? How can I control this? I added a centerAndZoom to the results function of the geocoder, but it seems to be first zooming in tight and then zooming out again. That's no good.
... View more
03-20-2015
02:06 PM
|
0
|
0
|
3847
|
|
POST
|
I feel like I've tried every option, but when I first wrote this, the agency was still at IE 8, and I was having issues with many things that worked just fine in the other browsers. "Just use Chrome" is not an acceptable workaround for my users, because the state standard is IE. I have also found that the emulators don't always emulate, for components like this in particular. It might not work on the emulators, but still on a particular device and vice versa. The agency has updated to IE 9 this past winter, so maybe if I go back to the generic HTML select, it will work now.
... View more
03-19-2015
06:26 AM
|
0
|
1
|
2892
|
|
POST
|
I have a dropdown of county names. I have tried a variety of different options, but it seems like everything I try works for either desktop or mobile, but not both. The closest I could come was the a dijit/form/DataList in conjunction with a dojox/mobile/comboBox. At least this displays both on the desktop as well as mobile. The problem is that the users don't like this behavior on the desktop. Rather than having a dropdown arrow or scrollbar they can use to see the names further down the list, they have to know to use the upward stroke/flicking motion more commonly associated with mobile. They don't like this. This starts out with a query screen and only loads the map if the user chooses to display it. We have a mandate for everything to be mobile friendly. In this case, the desktop experience is suffering. Vaccines for Children Providers
... View more
03-18-2015
02:37 PM
|
0
|
8
|
6381
|
|
POST
|
I got it to work. The syntax should be: function executeQuery(){
searchList.sort();
var sortedList = sortAndRemoveDuplicates(searchList);
var sortedString = sortedList.join("','");
var whereClause = "HOSP_TYPE IN ('" + sortedString + "')";
console.log("whereClause = " + whereClause);
searchQuery.where = whereClause;
qTask.execute(searchQuery,queryHandler);
}
... View more
03-17-2015
02:23 PM
|
0
|
0
|
1620
|
|
POST
|
If I have an array of values, can't use these as input to a where clause? I am allowing the user to select multiple checkboxes, pushing the values into an array as they check. Then I want to be able to create a where clause for either a queryTask or a featureLayer. I have an example of a where clause that looks like I can use IN, but I'm having a hard time getting the values from the array to be properly formatted. I am using a cbTree, which is a checkbox tree. The values from the checkboxes are getting populated into the array, I'm just not sure what to do with them next. <!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" />
<meta name="viewport" content="initial-scale=1, maximum-scale=1,user-scalable=no"/>
<title>CheckBox Tree Example</title>
<link rel="stylesheet" href="https://js.arcgis.com/3.11/dijit/themes/claro/claro.css"/>
<link rel="stylesheet" href="cbtree/themes/claro/claro.css"/>
<script type="text/javascript">
var dojoConfig = {
parseOnLoad: false,
async:true,
packages: [{
"name": "cbtree",
"location": location.pathname.replace(/\/[^/]+$/, "")+'/cbtree'
}]
};
</script>
<script type="text/javascript" src="https://js.arcgis.com/3.11/"></script>
<script type="text/javascript">
var popup, map, geocoder, layer, template, symbol;
var searchList = [];
var pathName = "https://myserver.mo.gov";
require([
"dojo/parser","dojo/dom-style", "dojo/dom-construct","esri/dijit/Popup","dojo/store/Memory",
"dojo/store/Observable","cbtree/Tree", "cbtree/store/ObjectStore", "cbtree/model/ForestStoreModel",
"cbtree/extensions/TreeStyling",
"esri/map", "esri/layers/GraphicsLayer",
"esri/symbols/PictureMarkerSymbol","esri/symbols/SimpleMarkerSymbol","esri/symbols/SimpleLineSymbol",
"esri/InfoTemplate","esri/tasks/query","esri/tasks/QueryTask",
"dojo/_base/Color", "dojo/dom","dojo/on","dijit/registry", "dojo/_base/array",
"dijit/layout/BorderContainer","dijit/layout/TabContainer","dijit/layout/ContentPane","dijit/form/Button",
"dijit/TitlePane", "dojo/domReady!" ], function (
parser,domStyle,domConstruct, Popup, Memory, Observable,Tree, ObjectStore, StoreModel,
TreeStyling, Map,GraphicsLayer,PictureMarkerSymbol, SimpleMarkerSymbol,
SimpleLineSymbol,InfoTemplate,Query,QueryTask, Color, dom,on, registry, arrayUtils) {
parser.parse();
var qTask = new QueryTask(pathName+"/arcgis/rest/services/DHSS/medicalFacility/MapServer/0");
var searchQuery = new Query();
searchQuery.returnGeometry = false;
searchQuery.outFields = ["Facility", "Address", "City","Hosp_Type", "OBJECTID"];//fields you want in your grid
var data = [
// { id: "Provider", name:"Provider Types", type:"header"},
{ id: "CA", name:"Critical Access", type:"parent"},
{ id: "GA", name:"General Acute Care", type:"parent"},
{ id: "LT", name:"Long Term Care", type:"parent" },
{ id: "PSY", name:"Psychiatric", type:"parent" },
{ id: "REH", name:"Rehabilitation", type:"parent" },
{ id: "VA", name:"Veterans", type:"parent"},
{ id: "OT", name:"Other", type:"parent"}
];
var store = new Memory( { data: data });
// var store = Observable( new Memory( { data: data }));
var model = new StoreModel( { store: store,
rootLabel: "Specialty Type",
showRoot:false,
query: {type: 'parent'},
});
tree = new Tree( {
model: model,
id: "tree02",
branchReadOnly: false,
branchcheckBox:true,
branchIcons: false,
nodeIcons: false,
leafIcons:false,
rootNode:false
}, "CheckboxTree" );
tree.startup();
// Establish listener and start the tree.
function checkBoxClicked( item, nodeWidget, evt ) {
var newState = nodeWidget.get("checked" );
var label = this.model.getLabel(item);
if( newState ) {
searchList.push(label);
} else {
}
}
//---------------this is the section I have questions about
function executeQuery(){
searchList.sort();
var sortedList = sortAndRemoveDuplicates(searchList);
var sortedString = sortedList.split(', ').join("','");
var whereClause = "HOSP_TYPE IN ('" + sortedString + "')";//clause isn't formated properly here
console.log("whereClause = " + whereClause);
query.where = whereClause;
queryTask.execute(query,queryHandler);
}
function queryHandler(results){
console.log("in queryHandler");
}
function sortAndRemoveDuplicates(arr) {
arr.sort( function(a, b) { return a - b; } );
var copy = arr.slice(0);
arr.length = 0;
for (var i = 0, len = copy.length; i < len; ++i) {
if (i == 0 || copy != copy[i - 1]) {
arr.push(copy);
}
}
return arr;
}
//event listeners
tree.on( "checkBoxClick", checkBoxClicked );
registry.byId('btnSearch').on('click', executeQuery);
});
</script>
</head>
<body class="claro">
<h1 class="DemoTitle">The CheckBox Tree with Multi State CheckBoxes</h1>
<p>
A basic CheckBox Tree using a dojo/store Memory store (non-observable).
</p>
<div id="CheckboxTree">
</div>
<button id="btnSearch" data-dojo-type="dijit/form/Button">Search</button>
</body>
</html>
... View more
03-17-2015
02:10 PM
|
0
|
1
|
6344
|
|
POST
|
I've been looking at this since I came in this AM. It seems like it has a lot of functionality, but I'm digging all over to figure out how it all fits together. I wondered if there were alternatives. I can get it to work very generically, but I hoped someone would say they'd used it and could provide me a decent example. It includes an example with the ESRI JS API, but it's out of date and isn't working for me. At the moment, I'm trying to figure out how to style it with no icons. I only want the check boxes, and it defaults to a folder/file set of symbols.
... View more
03-16-2015
08:09 AM
|
0
|
0
|
3634
|
|
POST
|
Thanks, I've seen it. I'm trying to also offer some sort of grouping or hierarchy. It's going to look a lot like a TOC, but with completely different functionality. If I can't figure it out, then I'll go to a single set of features without any type of grouping, and maybe handle the grouping with padding the styles.
... View more
03-16-2015
07:04 AM
|
0
|
2
|
3634
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 06-02-2017 02:38 PM | |
| 2 | 03-18-2022 10:14 AM | |
| 2 | 02-18-2016 06:28 AM | |
| 1 | 03-18-2024 07:29 AM | |
| 4 | 08-02-2023 06:08 AM |
| Online Status |
Offline
|
| Date Last Visited |
02-25-2025
01:56 PM
|