You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is there a way to implement a rowDoubleClick() Event ?
Sometimes it is better not to select a row with a single click, because every time a user (accidentally ) clicks in the table, the single click event is triggered.
The text was updated successfully, but these errors were encountered:
For now, you can implement that using something like this:
importSmartDataTablefrom'react-smart-data-table'consthandleOnDoubleRowClick=()=>{letnumOfClicks=0return(e,data)=>{numOfClicks++// Reset the number of clicks after a short timesetTimeout(()=>{numOfClicks=0},400)if(numOfClicks===2){numOfClicks=0alert('Double click')}}}consthandleOnRowClick=handleOnDoubleRowClick()constApp=()=>(<main><SmartDataTablename="test"data={data}onRowClick={handleOnRowClick}/></main>)
Though I'll consider extending the API to make it simpler, since I can see the benefit of having it built-in.
Hello,
Is there a way to implement a
rowDoubleClick()
Event ?Sometimes it is better not to select a row with a single click, because every time a user (accidentally ) clicks in the table, the single click event is triggered.
The text was updated successfully, but these errors were encountered: