drumjs icon indicating copy to clipboard operation
drumjs copied to clipboard

Its is not working for dynamically added options.

Open DileepGithubRepo opened this issue 9 years ago • 2 comments

If i added options dynamically elements are adding but if i drag up and down every time one number is missing.

for ex :i have 15 options ,first time it works if i do up and down 14 th num will be missing next time 13 num is missing so on...

DileepGithubRepo avatar Dec 17 '15 05:12 DileepGithubRepo

At line 271 add:

                this.updateItems = function() {
                    $(wrapper).remove();
                    var drum = new Drum(element, options, transformProp);
                    element.data('drum', drum);
                }

after in 343:

                updateItems : function() {
            if ($(this).data('drum'))
                                $(this).data('drum').updateItems();
                }

so call to update the items:

$(select).drum('updateItems');

ksfreitas avatar Nov 09 '16 17:11 ksfreitas

@ksfreitas you solution is not working properly. i downloaded your forked drum.js, but when i call the function with update parameters, the function does not work at all.

i am building an angularJS WebApp

update when you call .drum() for the first time and your

Brice187 avatar Jun 13 '17 10:06 Brice187