bootstrap-input-spinner
bootstrap-input-spinner copied to clipboard
How to pass an extra parameter to the decrement and increment button?
I use your input-spinner in a cart with different items. But i need to know how i can pass a parameter like data-id=... to the buttons. After that i am able to decrease or increase the quantity of that specific product in the cart. I am using the template in the props.
var props = {
autoDelay: 500, // ms threshold before auto value change
autoInterval: 50, // speed of auto value change, set to `undefined` to disable auto-change
buttonsOnly: true, // set this `true` to disable the possibility to enter or paste the number via keyboard
keyboardStepping: true, // set this to `false` to disallow the use of the up and down arrow keys to step
template: // the template of the input
'<div class="input-group ${groupClass}">' +
'<button style="min-width: ${buttonsWidth}" class="btn btn-decrement ${buttonsClass} btn-minus" type="button">${decrementButton}</button>' +
'<input type="text" inputmode="decimal" style="text-align: ${textAlign}; box-shadow: none; width: 20% !important;" class=""/>' +
'<button style="min-width: ${buttonsWidth}" class="btn btn-increment ${buttonsClass} btn-plus" type="button">${incrementButton}</button>' +
'</div>'
};