Giter VIP home page Giter VIP logo

Comments (4)

jassmith avatar jassmith commented on May 21, 2024 1

Hover buttons I think could be acheived just using an overlay and regular html DOM. That said I will work on some examples and see what I can come up with. The idea of letting a UriCell specify a displayData is a good one, will definitely do that. Single click should also be possible as an option.

from glide-data-grid.

jassmith avatar jassmith commented on May 21, 2024

Can you give me a rough mockup of what you want? I can probably come up with something and if not I will make it a mission to make sure it works.

from glide-data-grid.

reczy avatar reczy commented on May 21, 2024

Thanks for your consideration, @jassmith. I'll try to articulate the specific ui / functionalities I'm looking for below:

(A) Links to other pages

Status Quo

  • 3 mouse clicks to follow a link in a UriCell
  • Pressing Enter twice when focused on a UriCell results in moving the focus inside the grid to the next row / same column (see the "More Info" column of your "Column Grouping" example here)

Desired Features / Functionality

  • 1 mouse click to follow a link
  • Hit Enter once to follow the link
  • Ability to specify a label and a link (eg, cell will read "Glide" but have link to "https://www.glideapps.com/")

(B) Action Buttons

I'll offer 2 examples here.

Example 1 (barebones example)

The first is kind of a barebones example of what could accomplish the job. In essence, the desire here would be for the cell to act like a button (user clicks once or hits Enter to run a callback so I can open a modal in react or do whatever else).

glide-data-grid-issue-120-basic

Example 2

The next example is my current development implementation using react-table. It offers what I call convenience buttons (not sure if there's an actual name for them) that show up on row hover, and an ellipsis icon that can be clicked (mouse or Enter to open a dropdown for more keyboard accessibility). This would be my "wishlist" as I find this combination to be user-friendly and clean-looking.

glide-data-grid-issue-120

While I like having the convenience buttons that show up on row hover (I think they make for a really nice user experience), I certainly think they are a nice-to-have. The absence of click once to follow a link and row action buttons / dropdowns are more of a blocker for me.

As a final note, I've never worked with HTML5 Canvas before, so I'm not familiar with its strengths and limitations. If you have another approach or suggestion that accomplishes the same result in a canvas-friendly way, I'd love to see it!

Please let me know if you'd like me to provide any additional information or clarify anything above.

Thanks!

from glide-data-grid.

jassmith avatar jassmith commented on May 21, 2024

In order to do the single click behavior what you can do right now is pass onCellClicked and when you get a UrICell, open the uri and call preventDefault() on the args passed to onCellClicked

const onCellClicked = React.useCallback((c, args) => {
  const cell = getCellContent(c);
  if (cell.kind === GridCellKind.UriCell) {
    args.preventDefault();
    window.open(cell.data, "_blank");
  }
}, []);

from glide-data-grid.

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.