| Цитата |
|---|
Андрей Корнет написал: Да, но переделал подругому по правкам заказчика.
| Код |
|---|
BX.bindDelegate(this.setItemsCont, 'change', {tag: 'INPUT', props: {type: 'checkbox'}}, BX.proxy(this.changeToSet, this));
SetConstructor.prototype.changeToSet = function() {
var target = BX.proxy_context,
item,
itemId,
itemName,
itemUrl,
itemImg,
itemPrintPrice,
itemPrice,
itemPrintOldPrice,
itemOldPrice,
itemDiffPrice,
itemMeasure,
itemBasketQuantity,
i,
l,
newSliderNode;
item = target.parentNode;
itemId = item.getAttribute("data-id");
itemName = item.getAttribute("data-name");
itemUrl = item.getAttribute("data-url");
itemImg = item.getAttribute("data-img");
itemPrintPrice = item.getAttribute("data-print-price");
itemPrice = item.getAttribute("data-price");
itemPrintOldPrice = item.getAttribute("data-print-old-price");
itemOldPrice = item.getAttribute("data-old-price");
itemDiffPrice = item.getAttribute("data-diff-price");
itemMeasure = item.getAttribute("data-measure");
itemBasketQuantity = item.getAttribute("data-quantity");
// BX.remove(item);
if ($(BX.proxy_context).prop('checked')) {
this.setIds.push(itemId);
} else {
for (i = 0, l = this.setIds.length; i < l; i++)
{
if (this.setIds[i] == itemId) {
this.setIds.splice(i, 1);
}
}
}
this.recountPrice();
};
|
|
Можете полный код скинуть,? также пытаюсь на основе стандартного компонента реализовать функционал чекбокса. не удается