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.

Add click handler to a month view cell or ability to override render of individual cells

See original GitHub issue

Do you want to request a feature or report a bug?

Feature

What’s the current behavior?

Currently the only clickable items in a month view cell are the date and the individual events. There is no way to add a click handler to individuals cells in the month view grid. I would like to add click handler to the cell itself or have a way to pass in a RenderMonthCell Component which receives the date and activities for a given cell as props. If you have a good idea on how to implement, I would be happy to dig in and create a PR.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:5

github_iconTop GitHub Comments

4reactions
PiotrKujawacommented, Oct 26, 2018

I agree, this calendar should handle something like onSelectDay or onSelectCell. Or selectable prop should accept value of “single” which wouldn’t allow to select more than one slot and then onSelectSlot would be enough.

edit:

@JesusTSeger I just found something which may be useful for you components={{ dateCellWrapper: this.renderCell }}

renderCell is my custom function to return a react component which contains onClick listener

renderCell = props => (
        <Cell
            {...props.children.props}
            onClick={() => {
                this.handleSelect(props.value);
            }}
        >
            {props.children}
        </Cell>
    );
0reactions
PatrissolJunscommented, Jul 27, 2022

I agree, this calendar should handle something like onSelectDay or onSelectCell. Or selectable prop should accept value of “single” which wouldn’t allow to select more than one slot and then onSelectSlot would be enough.

edit:

@JesusTSeger I just found something which may be useful for you components={{ dateCellWrapper: this.renderCell }}

renderCell is my custom function to return a react component which contains onClick listener

renderCell = props => (
        <Cell
            {...props.children.props}
            onClick={() => {
                this.handleSelect(props.value);
            }}
        >
            {props.children}
        </Cell>
    );

Very good idea. I combined it with a style on DateCellWrapper to completely control all events on cells with:

  flex: 1 1;
  height: 100%;
  width: 100%;
  border: 1px solid #EFF1F2;
  background: transparent;
  z-index: 999;
  cursor: pointer;
Read more comments on GitHub >

github_iconTop Results From Across the Web

GWT - Clickhandler on a TextColumn in cellTable
My requirement goes this way - I have to display 5 columns of data in a cell table and one of the columns...
Read more >
Customization - Kendo UI for Vue Docs & Demos - Telerik
Override or modify the default rendering for the child components of the Kendo UI for Vue Calendar.
Read more >
Handling Events :: Eloquent JavaScript
Calling its addEventListener method registers the second argument to be called whenever the event described by its first argument occurs. Events and DOM...
Read more >
Exploring advanced customizations of react-table component ...
We can make a single cell clickable in row by applying an onClick event on the data of that cell and make it...
Read more >
How to Create Custom Android UI Components - Toptal
First, let's start with how the component looks. To keep thing simple, let's display days in a grid, and, at the top, the...
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