Giter Site home page Giter Site logo

Comments (6)

qiufeihong2018 avatar qiufeihong2018 commented on June 3, 2024

@icyhot12 What is this application scenario? Can it not be solved through the custom menu of the business side?

from reactgrid.

icyhot12 avatar icyhot12 commented on June 3, 2024

What do you mean by that "Can it not be solved through the custom menu of the business side?" ??

I have react app with react-grid implementation, and some users don't want to use enableRowSelection functionality because they can't select only first cell of any row (because with this prop enabled it is selecting whole row) so I am trying to add this functionality from right click context menu as you can see on the screenshot:

image

And it is almost working because the row is selected, but now I have problem when trying to copy the row to clipboard, when pressing cmd + C - nothing is copied, clipboard is empty.
Any ideas ?

I am setting selection of the row with reference to ReactGrid component, sth like that:
spreadSheetRef.current.spreadSheet.current.updateState(state => ({ ...state, selectionMode: "row", selectedIds: [pointetRowId] }))

Row is selected properly, but nothing is copied to clipboard.
edit: I think that this could be a problem with wrong focus after clicking option from context menu

from reactgrid.

Michota avatar Michota commented on June 3, 2024

I can't recreate your issue. Are you using v4.1.3?

from reactgrid.

icyhot12 avatar icyhot12 commented on June 3, 2024

I was using v4.0.5 but right now I raised version to v4.1.3 and the problem is still occurring.
What is your method for setting selection to whole row from right context menu ?
Can you show it ?

from reactgrid.

DLowHP avatar DLowHP commented on June 3, 2024

To be honest I'm a bit surprised that you've managed to update state using the reference to ReactGrid, but anyways: if you want to select row then according to selectOneRow from selectRange.ts you'd need to update both the selectedIds and selectedIndexes. Could you try that?

from reactgrid.

icyhot12 avatar icyhot12 commented on June 3, 2024

When I was dealing with other problem I figured it out that it was problem with wrong value for document.activeElement after clicking on my new option from context menu.
Right now it is working correctly, I am updating the state with
spreadSheetRef.current.updateState(state => ({ ...state, selectionMode: "row", selectedIds: [pointetRowId], selectedIndexes: [rowIndex], }))
but after that the key thing was to set focus to .rg-hidden-element......

from reactgrid.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.