We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy.
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

How to disable the palette

Thread ID:

Created:

Updated:

Platform:

Replies:

132224 Aug 21,2017 07:53 PM UTC Aug 23,2017 11:57 AM UTC JavaScript 3
loading
Tags: ejDiagram
Jim Jacobs
Asked On August 21, 2017 07:53 PM UTC

Hi,

I have what is probably a simple question.

When a diagram is initially loading, or a database update is in progress, I want to disable the palette so the user cannot drag shapes onto the canvas.

I've tried a few things, but none have worked.

Here's what my palette declaration looks like:

Of course, I want to disable this from client side code.

Any suggestions?

Thanks

Jim

Shyam G [Syncfusion]
Replied On August 22, 2017 12:27 PM UTC

Hi Jim, 
 
Initially, please remove the symbolpalette’s DiagramId property which you have defined in aspx.cs file and set it in the diagram create event, so that you can drag the shapes from the palette once the diagram is rendered. Please refer to the code example. 
 
Code example: 
 
            SymbolPaletteProperties symbolpalette = new SymbolPaletteProperties(); 
            //remove the diagramId property 
            //symbolpalette.DiagramId = "DiagramContent"; 
 
           DiagramContent.OnClientCreate = "create"; 
 
            function create() { 
                    $("#symbolpalette").ejSymbolPalette({ 
                        diagramId: "DiagramContent", 
                    }); 
                } 
 
Regards, 
Shyam G 


Jim Jacobs
Replied On August 22, 2017 01:30 PM UTC

Hi Shyam,

This will not work for us.

We need to have the palette disabled anytime we perform a webservice call.

Loading a new diagram (when we switch tabs) requires a webservice call. Other actions also required webservice calls.

During these calls, we display a busy signal in the upper right corner, just above the diagram.

So ideally, we want to disable the palette, start our webservice call, and when the call completes re-enable the palette.

Any thoughts on how to accomplish that?

Thanks

Jim


Shyam G [Syncfusion]
Replied On August 23, 2017 11:57 AM UTC

 
Hi Jim, 
 
When you start the webservice call, please set the symbol palette diagramId as null to disable the palette and once the webservice gets completed, re-enable the palette by setting diagram id to the symbol palette diagramId property. Please refer to the below code example below. 
 
Code example: 
  //disable palette at start of  webservice call 
                $("#symbolpalette").ejSymbolPalette({ 
                    diagramId: null, 
                }); 
 
//re-enable the palette once the webservice call completed 
$("#symbolpalette").ejSymbolPalette({  
                        diagramId: "DiagramContent",  
                    });  
 
 
Regards, 
Shyam G 


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

;