|
POST
|
Thanks Noah. I think it's a browser cache issue. I tested it at a different location and there was no error. I cleared browser cache on my dev machine and the deployed app no longer had issue. But thereafter the dev app had the error. Seems that after clearing cache the first app accessed doesn't have the error, but then the other does. If I resize the browser before reloading it will work in one, but then the other has the error. Kind of reminds me of 10 sp1 query bug. Not a big deal. I now know what's causing it and it won't be an issue for anyone accessing the deployed app. Occurs in Firefox and Chrome. Dev env: Apache on Win7 Deployed env: IIS on Win2012 AGS: 10.2.0 (3370)
... View more
02-12-2014
02:42 PM
|
0
|
0
|
508
|
|
POST
|
Try this. Comment out the 'populateGrid' function, just listen for 'update-end', and use the layers graphics to get attribute data. fl.on('update-end', function (r) { console.log(r); //just a check to see that the event fired var data = []; //use the layers graphics instead of making another request var data = array.map(fl.graphics, function (feature) { return { //property names used here match those used when creating the dgrid "id": feature.attributes[window.outFields[0]], "vehicleId": feature.attributes[window.outFields[1]], "velocity": feature.attributes[window.outFields[2]], "timestamp": feature.attributes[window.outFields[3]] } }); var memStore = new Memory({ data: data }); window.grid.set("store", memStore); }); I'm not positive, but 'update-end' should fire when the layer updates due to its updateInterval being set.
... View more
02-12-2014
11:40 AM
|
0
|
0
|
1999
|
|
POST
|
Okay the fiddle helps:
function populateGrid(Memory) {
//populate grid code here
//now listen for the feature layer update
fl.on('update', function () {
var qt = new QueryTask(window.unitsUrl);
var query = new Query();
query.where = "1=1";
query.returnGeometry = false;
query.outFields = window.outFields;
qt.execute(query, function (results) {
var data = [];
var data = array.map(results.features, function (feature) {
return {
// property names used here match those used when creating the dgrid
"id": feature.attributes[window.outFields[0]],
"vehicleId": feature.attributes[window.outFields[1]],
"velocity": feature.attributes[window.outFields[2]],
"timestamp": feature.attributes[window.outFields[3]]
}
});
});
window.grid.setStore(new Memory({
data: data
}));
});
} Something else you might look into is the feature layer's 'update-end' event and use the features of the feature layer directly to avoid extra requests to the server.
... View more
02-12-2014
10:13 AM
|
0
|
0
|
1999
|
|
POST
|
The gird is independent of the layer updating. You need to use an event to listen for the update of the feature layer and update the grid. Not knowing exactly how your app is setup, but assuming your layer is called "layer": layer.on('update', function () {
var qt = new QueryTask(window.unitsUrl);
var query = new Query();
query.where = "1=1";
query.returnGeometry = false;
query.outFields = window.outFields;
qt.execute(query, function (results) {
var data = [];
var data = array.map(results.features, function (feature) {
return {
// property names used here match those used when creating the dgrid
"id": feature.attributes[window.outFields[0]],
"vehicleId": feature.attributes[window.outFields[1]],
"velocity": feature.attributes[window.outFields[2]],
"timestamp": feature.attributes[window.outFields[3]]
}
});
});
window.grid.setStore(new Memory({
data: data
}));
}); Just a simple example, but hopefully gets you going in the right direction.
... View more
02-12-2014
10:05 AM
|
0
|
0
|
1999
|
|
POST
|
I looked at a couple of my grids and I simply create a new store and set it.
... View more
02-12-2014
09:15 AM
|
0
|
0
|
1999
|
|
POST
|
When your new data is returned, create a new store and set the grid's store to the new store. Or just reuse your store and reset its data. As I recall this should update the grid.
... View more
02-12-2014
09:08 AM
|
0
|
0
|
1999
|
|
POST
|
I'm getting a request error on feature layers "status: 0" only on the initial LOD. If I resize the map, then pan or manually refresh the layer, the error persists. But as soon as I zoom out of and back to the LOD it works. If I don't resize the map, as above, the error persists when zooming to the LOD. This isn't happening in my dev environment. Only when deployed. I can load any of the error urls in a new tab and returns with no problem. If I log the layer's 'error', I get "RequestError: Unable to draw graphic (null)". Any ideas on why this is? Thanks.
... View more
02-12-2014
08:59 AM
|
0
|
2
|
867
|
|
POST
|
The scenario: 1) two internal servers: one for AGS & SDE and one hosting web apps 2) no SSL because its all internal 3) FeatureServer(s) secured to control who can edit what 4) user selects service to edit and the layer is added and editing initiated 5) when application test deployed on AGS machine, identity manager popups and works fine via http 6) when deployed on the other machine (with proxy setup and tested), identity manager doesn't even initialize, i.e. no esri.IdentityManager or esri.id when secured service added The reference says: To prevent this the Identity Manager requires that you use POST over https to ensure your credentials are secure. I want to override this behavior. How? If not I'll just create my own login, but that's what I'm trying to get away from.
... View more
02-10-2014
11:20 AM
|
0
|
0
|
585
|
|
POST
|
Thanks Jon, I missed that part. I guess when I look at the return I expect to see everything I'm getting. Here's another for you. https://developers.arcgis.com/javascript/jsapi/featurelayer-amd.html#queryfeatures In the sample it shows "esri/tasks/Query" instead of esri/tasks/query".
... View more
02-05-2014
04:07 PM
|
0
|
0
|
515
|
|
POST
|
Here's some follow up for interested parties. Until yesterday I'd never really used PrintTask or associated classes, instead creating my own Web_Map_as_JSON and making a independent request for a couple reasons: 1) I didn't want to print all layers, e.g. a results layer or custom gp layer. 2) Sending attribute and info template json can exponentially increase the size of the request and with no benefit. And cause errors, especially with text symbols. This approach has worked well, but has required a lot more coding and code maintenance as dojo/jsapi have evolved. Wanting to reduce code and let the native esri classes do the heavy lifting, this is my 26 lines of code to get the same result. With the following understanding: 1) layers that are not to be printed are extended with layer._print = false;, 2) this example is out of a custom class (hence the hitching), and 3) this.map is in fact the map. esriRequest.setRequestPreCallback(lang.hitch(this, function (args) {
//Web_Map_as_JSON to js obj
var json = JSON.parse(args.content.Web_Map_as_JSON);
//remove map.graphics
json.operationalLayers.splice(arrayUtils.indexOf(json.operationalLayers, this.map.graphics.id), 1);
//remove non-print layers
arrayUtils.forEach(json.operationalLayers, function (ol) {
var layer = this.map.getLayer(ol.id);
if (layer._print && layer._print === false) {
json.operationalLayers.splice(arrayUtils.indexOf(json.operationalLayers, ol), 1);
}
}, this);
//strip graphic layer attributes and and info templates
arrayUtils.forEach(json.operationalLayers, function (ol) {
if (ol.featureCollection && ol.featureCollection.layers.length) {
arrayUtils.forEach(ol.featureCollection.layers, function (layer) {
arrayUtils.forEach(layer.featureSet.features, function (feature) {
if (feature.attributes) {
delete feature.attributes;
}
if (feature.infoTemplate) {
delete feature.infoTemplate;
}
});
});
}
});
//json to Web_Map_as_JSON
args.content.Web_Map_as_JSON = JSON.stringify(json);
return args;
})); A final consideration. If you are using a custom print task server side and need attributes to do something cool, like create a table of attributes for a selected feature or label graphics, then steps would need to be taken not to strip those attributes from those layers.
... View more
02-05-2014
11:05 AM
|
1
|
1
|
1865
|
|
POST
|
Got it. And figured out how to reset setRequestPreCallback so it doesn't fire on other requests. esriRequest.setRequestPreCallback(function (args) { //do stuff return args; }); this.printTask.execute(this.printParameters, lang.hitch(this, this._print), lang.hitch(this, this._error)); //reset esriRequest.setRequestPreCallback();
... View more
02-05-2014
09:10 AM
|
0
|
0
|
1865
|
|
POST
|
I'm having a brain block this morning and having problems using setRequestPreCallback with PrintTask. Thanks.
... View more
02-05-2014
08:34 AM
|
0
|
5
|
5763
|
|
POST
|
Thanks Jon, I'm aware of dgird's styling. Can't seem to find any examples of content fitting. I'll hit up dojo for an answer too. Ben
... View more
02-04-2014
07:41 AM
|
0
|
0
|
1628
|
|
POST
|
I have a dgrid as seen here: [ATTACH=CONFIG]31111[/ATTACH] I want the Title and Last Save columns to auto adjust to fit the widest cell without wrapping, thus leaving as much width as possible for the Description. I don't want to set the widths with css for a couple reasons: 1) what's the point if dynamic widths are the goal, and 2) the user can adjust the application font size. If anyone knows how this might be easily accomplished or has a suggestion I'd appreciate it.
... View more
02-04-2014
07:07 AM
|
0
|
4
|
7740
|
|
POST
|
Happened to be looking at esri/graphic and noticed that on 'graphic-add' says it returns the graphic object, when it returns an object consisting of the graphic and target (the layer). I know you guys have a lot going on, but keeping the reference up-to-date and correct seems critical. Since the switch to AMD, I don't trust the reference for event returns and just test returns myself in console when I work with new events. This isn't the only one that didn't get updated during the 'on' switch. As always, thanks for your consideration.
... View more
01-27-2014
08:34 PM
|
0
|
3
|
840
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 06-18-2013 06:56 AM | |
| 1 | 06-30-2015 09:17 AM | |
| 1 | 10-12-2013 07:14 AM | |
| 1 | 02-05-2014 11:05 AM | |
| 1 | 05-28-2015 11:41 AM |
| Online Status |
Offline
|
| Date Last Visited |
11-11-2020
02:23 AM
|