AnsweredAssumed Answered

Configure data sources with PI Vision custom symbol

Question asked by CareyTilden on Jul 17, 2017
Latest reply on Jul 17, 2017 by CareyTilden

I have a custom symbol that allows multiple data sources.  Sometimes I want to remove a data source I have added to the custom symbol.  I currently implement this via the right click configOptions menu (see below for sample code), but I would prefer to use the config panel, if possible.  My ideal solution would look like the Trace Options section in the Trend symbol.  Is there any way to accomplish this?

 

        configOptions: function (context, clickedElement) {

            var menuItems = [];

 

            menuItems.push({ title: 'Format Symbol', mode: 'format' });

 

            context.symbol.DataSources.forEach(function (item, idx) {

                menuItems.push({

                    title: 'Remove data source #' + (idx + 1),

                    action: function () {

                        context.symbol.DataSources.splice(idx, 1);

                    }

                });

            })

 

            return menuItems;

        }

Outcomes