[Kimchi-devel] [PATCHv2 1/3] Fix select menu data append

Aline Manera alinefm at linux.vnet.ibm.com
Tue Apr 22 17:44:50 UTC 2014



Reviewed-by: Aline Manera <alinefm at linux.vnet.ibm.com>


On 04/22/2014 06:05 AM, 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 | 3 ++-
>   1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/ui/js/widgets/select-menu.js b/ui/js/widgets/select-menu.js
> index 237797d..fa36b4c 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);
> @@ -59,7 +60,7 @@
>                       }
>                   });
>               } else {
> -                kimchi.message.code.error('KCHAPI6006E');
> +                kimchi.message.error.code('KCHAPI6006E');
>               }
>           },
>




More information about the Kimchi-devel mailing list