How to disable button duplicate and properties on connection dictionary?

Stimulsoft Dashboards.PHP discussion
Post Reply
investor123
Posts: 24
Joined: Fri Sep 20, 2013 4:18 am

How to disable button duplicate and properties on connection dictionary?

Post by investor123 »

Dear,

Can we disable or hide button duplicate and properties on the connection dictionary?

Image
investor123
Posts: 24
Joined: Fri Sep 20, 2013 4:18 am

Re: How to disable button duplicate and properties on connection dictionary?

Post by investor123 »

I also need to disable or hide Recent Connection when create new Data Source.

Image

Looking forward for any help. Thank you
Lech Kulikowski
Posts: 6252
Joined: Tue Mar 20, 2018 5:34 am

Re: How to disable button duplicate and properties on connection dictionary?

Post by Lech Kulikowski »

Hello,

Please try to check the following code:

Code: Select all

var designer = new Stimulsoft.Designer.StiDesigner(designerOptions, "StiDesigner", false);
            designer.renderHtml("content");

            designer.jsObject.InitializeSelectConnectionForm(function (form) {
                designer.jsObject.oldInitializeSelectConnectionForm_ = designer.jsObject.InitializeSelectConnectionForm_;

                designer.jsObject.InitializeSelectConnectionForm_ = function () {
                    var form = designer.jsObject.oldInitializeSelectConnectionForm_();
                    form.oldFillConnections = form.fillConnections;

                    form.fillConnections = function (connections) {
                        form.oldFillConnections(connections);
                        form.connectionGroups.Recent.style.display = "none";
                        form.container.firstChild.rows[0].firstChild.childNodes[1].getItemByName("Recent").style.display = "none";
                    }

                    return form;
                }
            });
Thank you.
investor123
Posts: 24
Joined: Fri Sep 20, 2013 4:18 am

Re: How to disable button duplicate and properties on connection dictionary?

Post by investor123 »

Hi Lech, its work great. :D

Image

Thank you so much for your help,

and my last request about disable or hide button duplicate and properties from context menu when we click on the connection tree. how to do it?

Image

Looking forward for your help.
Lech Kulikowski
Posts: 6252
Joined: Tue Mar 20, 2018 5:34 am

Re: How to disable button duplicate and properties on connection dictionary?

Post by Lech Kulikowski »

Hello,

Please check the following code:
var designer = new Stimulsoft.Designer.StiDesigner(designerOptions, "StiDesigner", false);
designer.renderHtml("content");

var dictionaryContextMenu = designer.jsObject.options.menus.dictionaryContextMenu || designer.jsObject.InitializeDictionaryContextMenu();
dictionaryContextMenu.items.properties.parentElement.removeChild(dictionaryContextMenu.items.properties);
dictionaryContextMenu.items.duplicateItem.parentElement.removeChild(dictionaryContextMenu.items.duplicateItem);

Thank you.
investor123
Posts: 24
Joined: Fri Sep 20, 2013 4:18 am

Re: How to disable button duplicate and properties on connection dictionary?

Post by investor123 »

Hi, I have done all of this and its work. Thank you very much
Lech Kulikowski
Posts: 6252
Joined: Tue Mar 20, 2018 5:34 am

Re: How to disable button duplicate and properties on connection dictionary?

Post by Lech Kulikowski »

Hello,

You are welcome.
Post Reply