[Kimchi-devel] [PATCH 1/2] Fix select menu data append

Hongliang Wang hlwang at linux.vnet.ibm.com
Fri Apr 18 06:39:09 UTC 2014


I found another problem in the JS file ui/js/widgets/select-menu.js, 
please correct it, too.

                 kimchi.message.code.error('KCHAPI6006E');

should be:
                 kimchi.message.error.code('KCHAPI6006E');

It's located at the end of setData function.

On 04/17/2014 04:42 PM, lvroyce at linux.vnet.ibm.com wrote:
> From: Royce Lv <lvroyce at linux.vnet.ibm.com>
>
> Select menu appended data to list,
> this results in items accumulating when everytime try to set data.
> Fix it by clear list before appending.
>
> Signed-off-by: Royce Lv <lvroyce at linux.vnet.ibm.com>
> ---
>   ui/js/widgets/select-menu.js | 1 +
>   1 file changed, 1 insertion(+)
>
> diff --git a/ui/js/widgets/select-menu.js b/ui/js/widgets/select-menu.js
> index 237797d..5109a50 100644
> --- a/ui/js/widgets/select-menu.js
> +++ b/ui/js/widgets/select-menu.js
> @@ -38,6 +38,7 @@
>               var itemTag = 'li';
>               var item;
>               if (options.length > 0) {
> +                that.listControl.find('li').remove();
>                   $.each(options, function(index, option) {
>                       item = $('<' + itemTag + '>' + option.label +'</' + itemTag + '>');
>                       item.data('value', option.value);




More information about the Kimchi-devel mailing list