Is there a way to make query results automatically shown in attribute table? That way it saves user 1 extra click. Thank you for your help.
Solved! Go to Solution.
Helen,
Sure that is simple as editing the _showResultLayerInfo function in the Widget.js (Add lines 15 - 20):
_showResultLayerInfo: function(resultLayerInfo){
this._hideAllSingleQueryResultDijits();
var singleQueryResult = resultLayerInfo.singleQueryResult;
var resutlLayer = null;
if (singleQueryResult) {
html.setStyle(singleQueryResult.domNode, 'display', 'block');
var currentAttrs = singleQueryResult.getCurrentAttrs();
resutlLayer = lang.getObject("query.resultLayer", false, currentAttrs);
}
if (resutlLayer) {
this._activeLayerId = resutlLayer.id;
this._hideAllLayers(resutlLayer);
resutlLayer.show();
//now show in at widget
var layerInfo = this.layerInfosObj.getLayerInfoById(resutlLayer.id);
this.publishData({
'target': 'AttributeTable',
'layer': layerInfo
});
}else{
this._activeLayerId = null;
this._hideAllLayers();
}
},
Helen,
Sure that is simple as editing the _showResultLayerInfo function in the Widget.js (Add lines 15 - 20):
_showResultLayerInfo: function(resultLayerInfo){
this._hideAllSingleQueryResultDijits();
var singleQueryResult = resultLayerInfo.singleQueryResult;
var resutlLayer = null;
if (singleQueryResult) {
html.setStyle(singleQueryResult.domNode, 'display', 'block');
var currentAttrs = singleQueryResult.getCurrentAttrs();
resutlLayer = lang.getObject("query.resultLayer", false, currentAttrs);
}
if (resutlLayer) {
this._activeLayerId = resutlLayer.id;
this._hideAllLayers(resutlLayer);
resutlLayer.show();
//now show in at widget
var layerInfo = this.layerInfosObj.getLayerInfoById(resutlLayer.id);
this.publishData({
'target': 'AttributeTable',
'layer': layerInfo
});
}else{
this._activeLayerId = null;
this._hideAllLayers();
}
},
Thank you very much Robert. I'm not a developer so everything seems too complicated to me 😞
I have this issue with query result in attribute table. Please see attached image.
If I click to select from the red arrow area, seam like that record is removed from the set. 1st time it zooms to the feature fine, but if I go back, I'll get the error "Data not available!"
If I click to select form the blue arrow area, it's fine. Just that the attribute record is not highlighted.
Do you experience the same thing ?
Call ESRI support, they said they can't replicate the error. It's weird because I've tried on different layers, different servers, same thing happen.
Helen,
I don't see the image.
Sorry!
Helen,
Yes I am seeing the same. When you select a row in the AT widget the feature is removed from the query results layer.
Then it is definitely a bug. Wonder why Esri told us they couldn't replicate the error!
Thanks a bunch Robert!
Thanks to you Robert, it works a treat!
what if I want different level of information in the attribute table from those in the Result Panel, which is supposed to be a list with very concise info and people normally display greater details in the attribute table and pop-up window. I found it's quite hard to achieve it by simply configuring the out-of-box Query widget... any suggestions? thanks.