bootstrap-touchspin icon indicating copy to clipboard operation
bootstrap-touchspin copied to clipboard

Consider allowing user to read plugin options

Open N4M3Z opened this issue 10 years ago • 1 comments

Please consider allowing the user to input/update/read the plugin options on the fly. I was able to create a separate input field that would update the step setting like so:

<input id="timestep" type="text" class="form-control" value="600">
...
$("#timestep").change(function()
{
    $("input").trigger("touchspin.updatesettings", {step: $("#timestep").val()});
});

I however found no way to show the boosted step value to the user. I tried to update the "timestep" input value but I could not read the step setting from the plugin itself:

$("input").trigger("touchspin.change");
{
    var step = $("#timestamp").TouchSpin().data("settings", "step");
    $("#timestep").val(step);
}

Is there perhaps a way to read the values of all the settings from plugin? Something like:

$("#timestamp").TouchSpin().step();

Thank you

N4M3Z avatar Jun 26 '15 11:06 N4M3Z

Thanks for the suggestion, I will refactor the plugin soon and will add methods to read the settings (and I will avoid using the trigger technique).

istvan-ujjmeszaros avatar Jun 26 '15 11:06 istvan-ujjmeszaros