-
Notifications
You must be signed in to change notification settings - Fork 4.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
DataTable Column with Template onRowClick/onRowSelect not firing #1485
Comments
Any updates on this problem? |
Here is a plnkr to demonstrate the issue. It will let you select a row outside of the text(template), but not select the text. http://plnkr.co/edit/IRqZFS7azPXqQUIVPFIB?p=preview Seems to be related to this code in DataTable.js DataTable.prototype.handleRowClick = function (event, rowData) { If we revert the code back, the select works again. DataTable.prototype.handleRowClick = function (event, rowData) { if (targetNode == 'INPUT' || targetNode == 'BUTTON' || targetNode == 'A' //if (targetNode == 'TD' || (targetNode == 'SPAN' && !this.domHandler.hasClass(event.target, 'ui-c'))) { |
Same issue here even with the 2.0.RC1. Thanks for the workaround ! |
Are there any plans to change this behaviour? This is one of those really annoying bugs that shouldn't be too hard to fix. |
I got this problem only when there's a template with a div inside the table cell. When removing the div element, the event works just fine. |
You are right, i just tested it. Solution is to use span with display: block/inline-block instead of div I guess. Thanks a lot for this! |
I'm facing the same issue. Without templates, selecting rows works just fine. With a template, I can only select a row when clicking an empty area in the row. Using a span with display block does not fix the issue for me unfortunately. |
Same issue here - using version 4.0.1 with Angular 4.1.2. However this appears to be related to the use of the innerHTML property (if I use innerText it works fine):
|
I get around this by changing above to the following:
Then in the (click) I do the following:
This uses the simulatedClick function: function simulatedClick(target, options) { var event = target.ownerDocument.createEvent('MouseEvents'), //Merge the options with the defaults //Pass in the options //Fire the event Works for me. |
I had the same problem, i fixed it by making the element in the template "click through able". |
I have the same issue. I have a To get it to work I changed the suggested code from:
To:
Is there a way to overwrite the method in your project somewhere somehow? How is it that this has not had any traction or comments from maintainers? |
I'm submitting a ... (check one with "x")
Plunkr Case (Bug Reports)
Please fork the plunkr below and create a case demonstrating your bug report. Issues without a plunkr have much less possibility to be reviewed.
http://plnkr.co/edit/NtWWnN
Current behavior
Neither onRowClick nor onRowSelect fire if there is a template column in the datatable. If I remove the template, then all is well, but I need the template.
Expected behavior
That all events fire as normal.
Minimal reproduction of the problem with instructions
I don't know how to use plunker and haven't been able to get one running successfully. Here is a code snippet indicating the problem.
What is the motivation / use case for changing the behavior?
Please tell us about your environment:
angular-cli: 1.0.0-beta.19-3
node: 6.3.1
os: win32 x64
2.2.0-beta.0
1.0.1
all
typescript 2.0.7
node --version
=The text was updated successfully, but these errors were encountered: