return false;
});
- this.element.on('change', 'input' + this.bmidselector +
- ',select' + this.bmidselector +
- ',textarea' + this.bmidselector +
- ',.dropzone' + this.bmidselector, function () {
+ this.element.on('change', 'input' + this.bmidselector + ',select' + this.bmidselector + ',textarea' + this.bmidselector + ',.dropzone' + this.bmidselector, function () {
$this.updateAndChange();
return true;
});
}, 1000);
this.resize();
+
+ setInterval(function () {
+ $this.serialize();
+ }, 2000);
},
cleanTemplate: function () {
},
serialize: function () {
-
-
var val = [];
var $this = this;
var id = this.element.attr('id');
- $.each(this.element.find('.item' + this.bmidselector + ':not(.sample) .bunchfields' + this.bmidselector), function () {
+ var selector = '.item' + this.bmidselector + ':not(.sample) ' + this.bmidselector + ' .bunchfields';
+ var list = this.element.find(selector);
+
+ $.each(list, function () {
$(this).find('.bunchmultiple').each(function () {
try {
$(this).data('bunchmultiple').serialize();
var $this = this;
new Sortable(this.element.find('.bunchmultiple__items' + this.bmidselector).get(0), {
- handle: '.sort-handle',
- ghostClass: 'ghost',
- onSort: function (evt) {
+ handle: '.sort-handle', ghostClass: 'ghost', onSort: function (evt) {
$this.onSort(evt);
},
});
// Allow user to set any option except for dataType, cache, and url
options = $.extend(options || {}, {
- dataType: "script",
- cache: true,
- url: url
+ dataType: "script", cache: true, url: url
});
// Use $.ajax() since it is more flexible than $.getScript