From: Vincent Vanwaelscappel Date: Mon, 11 Jul 2022 12:52:34 +0000 (+0200) Subject: wait #5351 @0.25 X-Git-Url: http://git.cubedesigners.com/?a=commitdiff_plain;h=c916bc8497f502aade270b519010554991db6be3;p=cubist_cms-back.git wait #5351 @0.25 --- diff --git a/src/public/bunchmultiple/bunchmultiple.js b/src/public/bunchmultiple/bunchmultiple.js index f461a67..a322a4c 100644 --- a/src/public/bunchmultiple/bunchmultiple.js +++ b/src/public/bunchmultiple/bunchmultiple.js @@ -212,6 +212,24 @@ this.updateAndChange(); }, + empty: function (update) { + $(this.element).find('.item:not(.sample)').remove(); + if (update !== false) { + this.updateAndChange(); + } + }, + + replaceData: function (data) { + console.log(data); + this.empty(false); + var $this = this; + $.each(data, function (k, v) { + console.log(v); + $this.initItem(v); + }); + this.updateAndChange(); + }, + updateAndChange: function () { if (!this.inited) { return;