There is now a demand is a column of datatables, right-click the can open a right-click menu
At first the idea is to add a render in this column, put a hidden div render, then by div to obtain click position, because of the need to right-click menu + obtain click on the location of the data
The results did not succeed, because can't give each row in the column binding a separate id, there are too many data
Then considering the click event of datatables, if we can change the mouse the left key click events to right-click can perfectly realize the
So I want to ask bosses, how can change the mouse the left key click event of datatables to right-click
Or ever bosses have better ideas, very grateful!
CodePudding user response:
Document. The getElementById (" test "). onm ousedown=function (e) {If (e.b utton==2) {
Alert (" you some right ");
} else if (e.b utton==0) {
Alert (" you ordered left ");
} else if (e.b utton==1) {
Alert (" you ordered roller ");
}
}
CodePudding user response: