02-21-2017 11:30 PM
Hi,
We have been asked to quickly estimate a customization effort, that basically needs to prefills the Thematic Item window in Geospatial Portal, with certain min, max and distinct values. We want to reuse the Thematic Item window, so that we do not have to redo the entire functionality, styling, drawing etc. However, in order to prefill fields, we need to know when the Thematic Item window is opened. We have been looking in the examples and API, but we cannot find anything related.
Is it possible, via the API, to register an event for this Thematic Item window opening?
Thanks.
03-16-2017
06:39 AM
- last edited on
03-16-2017
08:16 AM
by
pszrajber
Hi there,
Once I needed to something like this, I hope it can help you.
See the example below:
//For you to be able to get the "MapContentCategorizedExt" you have to set the clientIdMode to Static of the element //on the full.aspx page, or other page you are using, see example: //this code is in my Full.aspx******************* <wc_core:MapLegendControl runat="server" id="MapContentCategorized" MapStateId="map" Mode="Categorized" meta:resourcekey="Categories" ClientIdMode = "static" />
//*********************************************** //Registering the "expandnode" event of the treeview, //you can do this inside the $GP.ready(function () {}) $GP.ready(function() { Ext.getCmp('MapContentCategorizedExt').on('expandnode', function(a, b, c) { //Verify if it is a tematic root node, or if the node was already ajusted (a.moniker != undefined) if (!a.attributes.isThematicMap || a.moniker != undefined) return; //Iterate over the tematic items for (var i = 0; i < a.childNodes.length; i++) { //you can add as many properties as you need a.childNodes[i]["moniker"] = 'whatever'; a.childNodes[i]["icon"] = 'whatever'; a.childNodes[i]["metadate"] = 'whatever' } }) })