-
Notifications
You must be signed in to change notification settings - Fork 26
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
Make entire row selectable #88
Comments
Look at the mods part in the documentation
|
Did that solve your problem? |
Please reopen if you think mods are not what you're looking for. |
Here's a solution that I came up by modifying the mod, "toggle-open-state-on-label-click.js". tpl = tpl.replace(/(class="(?:.?)ams-item(?:.?)")/gi, '$1 ng-click="toggle_check_node(item)"'); ^ won't work because it'll add toggle_check_node to both "ams-item" and "ams-items". This will create a null error because ams-items is outside of the ng-repeat scope found on ams-item so the item being passed into the function does not exist. tpl = tpl.replace(/(class="(?:.?)\Wams-item\W(?:.?)")/gi, '$1 ng-click="toggle_check_node(item)"'); ^ won't work exactly because it double-toggles when clicking on the checkmark. This is because the checkmark element in the original template has it's own "toggle_check_node" event, and because it is nested within "ams-item" ng-click ends up being triggered for both. Because the checkmark ends up being toggled twice, any change is nullified when clicking the checkmark and it will look like nothing is happening. In the end, you need something like the below 2 lines: tpl = tpl.replace(/(ng-click="toggle_check_node(item)")/gi, ""); The above removes prior instances of toggle_check_node from the original template before adding one onto ams-item [which represents a full row]. Please note that I didn't test this for a multi-select with subitems though so I have no clue if clicking a subitem will select the parent row or just the subitem itself. |
Only having the check icon as the selectable area is not very good for usability. I would like to be able to select an option by clicking anywhere on that row.
Thanks,
Joakim
The text was updated successfully, but these errors were encountered: