Page 1 of 1

[REACT] Disabling cellClick Event for Resource Columns in Timeline View

Posted: Mon Aug 12, 2024 1:11 pm
by prasath

We have implemented cellClick mainly for the date resource cells in the timeline view to get the clicked cell date. Is it possible to disable cellClick in the resource column alone?
PFA video for your reference,

CellClick to disble in resource column alone.mp4
Cellclick disable in resource column
(6.04 MiB) Downloaded 10 times

Re: [REACT] Disabling cellClick Event for Resource Columns in Timeline View

Posted: Mon Aug 12, 2024 1:23 pm
by tasnim

Hi,

You can just check with an if statement that if you're not clicking on the resource cell then log the date you've clicked. That way you'll only get the date when you click on the date cell.

Hope this helps.


Re: [REACT] Disabling cellClick Event for Resource Columns in Timeline View

Posted: Mon Aug 12, 2024 1:28 pm
by prasath

Hi Tasnim,
We have used cellclick method to get details of particular cell along with date.The need is whether its possible to restrict click on resource cell columns alone since its not needed there as of now.If possible can you suggest a way to do this.


Re: [REACT] Disabling cellClick Event for Resource Columns in Timeline View

Posted: Mon Aug 12, 2024 2:35 pm
by marcio

Hey prasath,

You can use the following snippet (please note that on the snippet the resource is mapped on name field, which could be different on your project)

listeners: {
        cellClick: ({ column }) => {
            if(column.field !== 'name') {
                console.log('click not resource column')
            }
        }
    }

Re: [REACT] Disabling cellClick Event for Resource Columns in Timeline View

Posted: Tue Aug 13, 2024 2:39 pm
by prasath

Its working as expected marcio.Thanks