Search and Top Navigation
#15075 closed bug (worksforme)
Opened October 07, 2016 02:49PM UTC
Closed October 12, 2016 04:30PM UTC
Last modified October 12, 2016 04:35PM UTC
Custom Selectmenu with _renderItem crashes when calling "refresh"
Reported by: | matzechecksout | Owned by: | |
---|---|---|---|
Priority: | minor | Milestone: | none |
Component: | ui.selectmenu | Version: | 1.12.1 |
Keywords: | Cc: | ||
Blocked by: | Blocking: |
Description
jQuery Version 3.1.1
$.widget('custom.bugselectmenu', $.ui.selectmenu, { _renderItem: function ($ul, option) { var $li = $('<li>', { text: option.label }); return $li.appendTo($ul); } }); $option.bugselectmenu('refresh');
When calling refresh, there is a null reference exception.
Attachments (0)
Change History (3)
Changed October 09, 2016 02:28PM UTC by comment:1
description: | jQuery Version 3.1.1 \ \ $.widget('custom.bugselectmenu', $.ui.selectmenu, { \ _renderItem: function ($ul, option) { \ var $li = $('<li>', { text: option.label }); \ //var item = $(option.element).data('optionItem'); \ //if (item.style) $li.css(item.style); \ return $li.appendTo($ul); \ } \ }); \ \ $option.bugselectmenu('refresh'); \ \ When calling refresh, there is a null reference exception. \ → jQuery Version 3.1.1 \ \ {{{#!js \ $.widget('custom.bugselectmenu', $.ui.selectmenu, { \ _renderItem: function ($ul, option) { \ var $li = $('<li>', { text: option.label }); \ return $li.appendTo($ul); \ } \ }); \ \ $option.bugselectmenu('refresh'); \ }}} \ \ When calling refresh, there is a null reference exception. |
---|
Changed October 12, 2016 04:30PM UTC by comment:2
resolution: | → worksforme |
---|---|
status: | new → closed |
Menu items now require block elements. See http://jqueryui.com/upgrade-guide/1.12/#require-wrappers-for-each-menu-item
Here's a working example: http://jsbin.com/vuvara/1/edit?html,js,output
Changed October 12, 2016 04:35PM UTC by comment:3
jsbin didn't save my updated example for some reason. Here it is: http://jsbin.com/pufevezoja/1/edit?html,js,output