How to disable the Zoom-In and Zoom-out or Scaling disabled for a palette

I have a palette with Nodes in It, How can I disabled the property of Zoom in and Zoom out. Because when I use the mouse of my Laptop, Sometimes while selecting If I pinch the mouse, The whole palette Zooms-out or Zooms -in. Please Help

Set allowZoom: false.
Read more about permissions at GoJS User Permissions -- Northwoods Software

Yes, I tried the same but its giving me this error
Trying to set undefined property "allowZoom" on object: GridLayout()

This is how I have initialised the palette

GJS(go.Palette, 'palette-triggers', {
              layout: GJS(go.GridLayout, { alignment: go.GridLayout.Location,
                                            sorting: go.GridLayout.Forward,
                                            allowZoom: false,
                                            arrangement : go.GridLayout.LeftToRight ,
                                            spacing: new go.Size(45 , 10) ,
                                            wrappingColumn: 3 })
          });

The error message is saying that there is no “allowZoom” property on the GridLayout class.

That property is on the Diagram class: Diagram | GoJS API. So you need to set the property on the diagram, in this case the instance of the Palette class.

Note that JavaScript allows you to set any property on any object. GraphObject.make is doing this error checking so that you do not accidentally put some property assignment on the wrong object, as you have just done. Setting some unknown property on an object would have no effect at all, which without the error message would have left you wondering why it didn’t work.

1 Like

Thanks! , It was my mistake I applied in the wrong place. Thanks for correcting and Explaining.