So I've read the only way to publish data is though the Widget.js because it derives from base widget. My issue is that I would like to publish data from the SingleQueryResult.js in the Query widget. When the user selects a result from the query list I need it to publish data. I read something on being able to grab it from the "Parent Widget" but not sure how to implement this.
_selectResultTr: function(tr, feature, result, layerDefinition, config) {
this._unSelectResultTr();
this.resultTr = tr;
var currentAttrs = this.getCurrentAttrs();
var config = currentAttrs && currentAttrs.config;
var url = currentAttrs.config.url;
var objectIdField = currentAttrs.config.objectIdField;
var relationships = this._getCurrentRelationships();
var feature = tr.feature;
if (this.resultTr) {
html.addClass(this.resultTr, 'jimu-state-active');
var wManager = WidgetManager.getInstance();
var pm = PanelManager.getInstance();
pm.showPanel(this._getWidgetConfig("PopupPanel")).then(lang.hitch(this, function() {
this.publishData({
'target': 'PopupPanel',
'data': feature.attributes["PARID"]
});
}));
console.log("Result row was clicked " + feature.attributes["PARID"]);
}
},
Any help on this would be awesome!
Solved! Go to Solution.
Martin,
There is already an example of publishing data from the SingleQueryResult.js in that file. Look at the _openAttributeTable method.
Martin,
There is already an example of publishing data from the SingleQueryResult.js in that file. Look at the _openAttributeTable method.
Ah good catch. I didn't even notice that at the bottom of the page. Thanks Robert!