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. Image for the cookie policy date

How to disable the palette

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

3 Replies

SG Shyam G Syncfusion Team 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 



JJ Jim Jacobs 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



SG Shyam G Syncfusion Team 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 


Loader.
Live Chat Icon For mobile
Up arrow icon