ASP.net
Awesome
Learn
Forum
Buy
Demos
Sign In
☾
☀
Switch to
Dark
Light
Mode
this site works best with javascript enabled
Ask Question
How can I summarize the total for new inline create rows
Title:
B
I
{code}
?
Say there is an Add button on the top. User clicks on Add that creates an empty row As soon as user enters a value for Price and tabs out we want to sum all Prices for just NEW Records and show it outside the grid. If the user is satisfied then s/he clicks on the SAVE ALL button to save everything in the grid.
Save Changes
Cancel
Riya Dasgupta
asked at 01 Mar 2021
Answers
B
I
{code}
?
here's an example: var g = $('#DinnersInlineCrudGrid'); g.on('change', '.o-glnew input.awe-txt', function(e){ var res = 0; g.find('.o-glnew input.awe-txt').each(function(){ res += $(this).val().length; }); console.log(res); }); this will show in the console the total length of the all inputs with awe.txt class
Save Changes
Cancel
Omu
answered at 02 Mar 2021
This is what I got finally. Seems to work but wanted to check if you notice anything that might give inconsistent behavior with the content of the grid changing var grid = $('#NetReceivedGrid'); grid.on('change', '.o-glnew input.awe-txt', function () { var res = 0; grid.find('.o-glnew .netReceivedClass input.awe-val').each(function () { res +=parseFloat($(this).val()); }); console.log(res); });
at 03 Mar 2021
Riya Dasgupta
please
Sign In
to leave an answer
By accessing this site, you agree to store cookies on your device and disclose information in accordance with our
cookie policy
and
privacy policy
.
OK