/* * Modify attribute Display Names in the Feature Info Control for PSS * This snippet overwrites core method and uses newly introduced AliasName taken * from a global dictionary of aliases that can be modified in runtime. * 2017-11-24 Piotr Szrajber <piotr.szrajber@hexagongeospatial.com> */Sys.Application.add_init(function(){$ALIAS_NAMES={"Field1":"Another name for the first field","Field2":"Other name for field 2"}// add additional custom field to the store using global dictionary of aliasesfunctionaddAliases(items){for(vari=0,l=items.length;i<l;i++){items[i].data.AliasName=$ALIAS_NAMES[items[i].data.Name]||items[i].data.Name;}}// overwrite the core - change the column used for displaying "Name" and execute custom method on the storevarorig=Intergraph.WebSolutions.Core.WebClient.Controls.FeatureInfoControl.prototype._getAttributeGroupPanel;Intergraph.WebSolutions.Core.WebClient.Controls.FeatureInfoControl.prototype._getAttributeGroupPanel=function(){// ATTENTION PLEASE!!! Make some check for particular feature classes in order not to break other feature infos :)varret=orig.apply(this,Array.prototype.slice.call(arguments));ret.columns[0].dataIndex="AliasName";addAliases(ret.store.data.items);returnret;}});
Comments (0)
HTTPSSSH
You can clone a snippet to your computer for local editing.
Learn more.