Search and Top Navigation
#9842 closed bug (invalid)
Opened February 20, 2014 01:18AM UTC
Closed March 07, 2014 08:49AM UTC
Last modified March 07, 2014 05:32PM UTC
buttonset methods fail when dom is modified causing 'cannot call methods on button prior to initialization' exception
Reported by: | jamie_pate | Owned by: | jamie_pate |
---|---|---|---|
Priority: | minor | Milestone: | none |
Component: | ui.button | Version: | 1.10.3 |
Keywords: | Cc: | ||
Blocked by: | Blocking: |
Description
I ran into this issue while using https://github.com/angular-ui/ui-utils/tree/master/modules/jq
Due to the dynamic nature of angularjs and ng-repeat the buttonset contents would sometimes be modified. Once the ui-jq directive called $(elm).buttonset('refresh') it would throw '''cannot call methods on button prior to initialization; attempted to call method 'widget''''
After much research I determined that the radioGroup() function was not checking to make sure that all the buttons it found were in fact buttons before calling jqueryui methods on them.
My work-around simply removes the constraint via Monkey-patching:
(function($) { 'use strict'; var orig_button = $.fn.button; $.fn.button = function(options) { if (!$(this).is(':ui-button')) { orig_button.call(this); } orig_button.call(options); }; })(jQuery);
Attachments (0)
Change History (3)
Changed February 20, 2014 04:50PM UTC by comment:1
component: | ui.core → ui.button |
---|---|
owner: | → jamie_pate |
status: | new → pending |
Changed March 07, 2014 08:49AM UTC by comment:2
resolution: | → invalid |
---|---|
status: | pending → closed |
Because we get so many tickets, we often need to return them to the initial reporter for more information. If that person does not reply within 14 days, the ticket will automatically be closed, and that has happened in this case. If you still are interested in pursuing this issue, feel free to add a comment with the requested information and we will be happy to reopen the ticket if it is still valid. Thanks!
Changed March 07, 2014 05:32PM UTC by comment:3
I'm unable to duplicate it manually, my effort can be found here: http://jsfiddle.net/34Cpk/3/
Perhaps this bug is better raised here: https://github.com/angular-ui/ui-utils/tree/master/modules/jq
https://github.com/angular-ui/ui-utils/issues/196
Some peculiar interaction is going on with the rendering of angular templates with ng-repeat
Why do you have radios in the set that aren't buttons? Please provide a reduced test case showing how this situation would occur.