Triggering onChange on click of spinner in grid row textbox
I am giving a textbox in grid column for numeric field. The onchange event is triggering when I change spinner and then click on outside but I wanted to trigger onchange event for the textbox when the spinner is clicked and value is changed in textbox without the need of clicking outside to trigger onchange event on textbox.
This is the code of view file:
var textBoxQuantity = Html.Awe().TextBox("Quantity").Prefix(".(Id)")
.Numeric(o => o.Min(1.0)).Value(".(Quantity)")
.HtmlAttributes(new { onchange = "onQtyChange(event)" })
.CssClass("w-100")
.ToString();
@(Html.Awe().Grid("TestGrid")
.Url(Url.Action("GridGetItems", "Test"))
.ShowGroupBar(false)
.Mod(o => o.Main().Loading().MovableRows())
.Columns(
new Column { ClientFormat = ".Id", Name="Id",Width = 80, Resizable = false, Hidden=true},
new Column { Bind="Quantity",Width=95, Header="Qty" , ClientFormat= textBoxQuantity }))
Sam Mosaic
asked
at 20 Nov 2023
Answers
-
Ideally you would update to the latest version, you can try this workaround js script for now:
$(document).on('mouseup', '.awe-spinbtn', function(){
$(this).closest('.awe-field').find('.awe-val').change();
console.log($(this).closest('.awe-field').find('.awe-val').val());
});Omuanswered at 20 Nov 2023-
Thanks it worked for me.at 20 Nov 2023 Sam Mosaic
-
change
is triggered when clicking the spin buttons in v. 7.7