How can i change height of button in SpreadJS

Posted by: ngocnguyen09910060 on 29 March 2022, 1:17 pm EST

    • Post Options:
    • Link

    Posted 29 March 2022, 1:17 pm EST

    Hi teams,

    On my web application, i have a cell that includes 2 buttons.

    This is my current code:

    
    const buttons = new GC.Spread.Sheets.Style();
    buttons .foreColor = 'black';
    buttonCell.cellButtons = [
      {
    	caption: Edit,
    	position: GC.Spread.Sheets.ButtonPosition.left,
    	useButtonStyle: true,
    	enabled: true,
    	command: (sheet, row, col, option) => {},
    	width: 100,
      },
      {
    	caption: Delete,
    	position: GC.Spread.Sheets.ButtonPosition.right,
    	useButtonStyle: true,
    	enabled: true,
    	command: (sheet, row, col, option) => {},
    	width: 100,
      },
    ]
    
    

    I’m facing an issue: when end user resize height of row, height of buttons is auto resized. I want to fix height of buttons is 50px. But i can’t find any properties for my expectation.

    How can i do it ?

  • Posted 30 March 2022, 8:29 am EST

    Hi Ngọc,

    Currently, there is no APIs present to set the height of button. The height of button depends on the Cell’s height.

    You can create your custom cell type to implement the required behavior: https://www.grapecity.com/spreadjs/demos/features/cells/cell-types/custom/purejs

    Please let us know if you need further assistance.

    Regards

    Ankit

Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels