Button hover styles

Posted by: shanmukha.vangaru on 23 May 2021, 4:51 pm EST

    • Post Options:
    • Link

    Posted 23 May 2021, 4:51 pm EST

    Hi,

    Is there a way to change the cursor type to pointer(hand pointer) when hovered on the cell of type button ?

    Regards

    Shanmukha

  • Posted 23 May 2021, 11:47 pm EST

    Hi Shanmukha,

    For this you need to set the empty hover state(so that cell should be repainted on hover state) to the button then you need to change pointer inside the paint if the state is hover. Please refer to the following codes snippet and attached sample that demonstrates the same.

    
     let state = options.sheet.cellStates.getState(options.row, options.col);
          if (state === GC.Spread.Sheets.CellStatesType.hover) {
            let canvasEl: any = spread
              .getHost()
    
              .querySelector('[gcuielement="gcWorksheetCanvas"]');
            if (canvasEl && canvasEl.style.cursor === "default") {
              canvasEl.style.cursor = "pointer";
            }
          }
    
    

    sample:https://codesandbox.io/s/react-typescript-forked-8s80b?file=/src/index.tsx

    Regards,

    Avinash

Need extra support?

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

Learn More

Forum Channels