question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

RowClickFunction could have other returns besides string

See original GitHub issue

I would like to raise a dissussion about the data-grid prop

rowClick?: string | RowClickFunction;

My question is on top of RowClickFunction, why does it always expect a string? I say for the case when the row is not valid when redirecting I could return a void, undefined or false, what do you think?

Why would RowClickFunction always need to return string and for me to keep it on the page I have to add a return ''

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:5 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
fzaninottocommented, Oct 5, 2022

As I understand, in your case, a click on a datagrid row may or may not have an action. If this is the case, this should be handled before the rowClick function is called, because the pointer shows that a row is clickable. It would be misleading for end users to indicate with the mouse pointer that a row is clickable, then do nothing on click.

So I suggest adding something like the current isRowSelectable prop to the Datagrid - why not isClickable?

But I don’t think we should accept a false or null response to rowClick.

0reactions
fzaninottocommented, Oct 10, 2022

This is not a use case we want to support out of the box. If you need that UX, you’ll have to pass your own DatagridRow, or a build a custom Datagrid altogether.

Read more comments on GitHub >

github_iconTop Results From Across the Web

JavaScript - Clickable table row except last 2 columns
I have tried using the following line but just can't seem to get it to work. Is there a line of code I'm...
Read more >
Flask WTForms example for dynamic list (javascript) with data ...
Example of a dynamic list (add, remove button handled on client side) with data stored in a classic String in database. Works with...
Read more >
Javascript/jQuery problems - SitePoint
I've got the latest version of jquery, but I think the .on() works a little bit different, right? Yeah, it does: Normal syntax:...
Read more >
Create interactive tables with Tabulator - Creative Bloq
Build dynamic tables quickly with Tabulator.
Read more >
Reader question – How does the Flexible View ... - XPage.me
One question I have is how best to deal with response documents ... can be configured to include the position data in addition...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found