Auto add calculation by column pop up link
Hi,
1. I have a problem regarding jquery auto add calculation. It is a timesheet hour calculation. Basically, I've done 90% of it and other 10% I cant seem to be found the solution.
This the script:
- <script type="text/javascript">
- $(document).ready(function () {
-
- $('[data-toggle="popover"]').popover();
- $('[id*=remarks_link]').popover();
-
- function DisableDays(date) {
- var day = date.getDay();
- // If day == 5 then it is FRiday only enable understand bijes
- if (day == 5) {
- return [true];
- } else {
- return [false];
- }
- }
- $(function () {
- $('[id*=tb_date_pick]').datepicker({
-
- changeMonth: true,
- dateFormat: 'dd/mm/yy',
- todayHighlight: true,
- showAnime: 'fadeIn',
- duration: 'fast',
- beforeShowDay: DisableDays
- });
- });
-
- $(function () {
- $('#<%= GridView1.ClientID %> .tb_day').val("0");
- });
- $('#<%= GridView1.ClientID %> .tb_day').blur("change", function () {
- if (isNaN(parseInt($(this).val()))) {
- $(this).val('0');
- } else {
- $(this).val(parseInt($(this).val()).toString());
- }
- });
- $('#<%= GridView1.ClientID %> .tb_day').blur("keyup", function () {
- if (!jQuery.trim($(this).val()) == '') {
- if (!isNaN(parseFloat($(this).val()))) {
- var row = $(this).closest("tr");
- $("[id*=hTest]", row).val(parseFloat($("[id*=tb_nt_sat]", row).val()) + parseFloat($("[id*=tb_nt_mon]", row).val()) + parseFloat($("[id*=tb_nt_tue]", row).val()) + parseFloat($("[id*=tb_nt_wed]", row).val()) + parseFloat($("[id*=tb_nt_thu]", row).val()) + parseFloat($("[id*=tb_nt_fri]", row).val()));
- }
- } else {
- $(this).val('');
- }
-
- var grandTotal = 0;
- $("[id*=hTest]").each(function () {
- grandTotal = grandTotal + parseFloat($(this).val());
- });
- $("[id*=total_nt]").val(grandTotal.toString());
-
- var satTot = 0;
- var col = $(this).closest("td");
- $("[id*=tb_nt_sat]").each(function () {
-
- satTot += parseFloat($("[id*=tb_nt_sat]", col).val());
- // satTot += parseFloat($(this).val());
- });
- $("[id*=tb_nt_sat_tot]").val(satTot.toString());
-
- });
-
- });
- </script>
The 'satTot' seems not working as i expect( Auto add dynamically by column in gridview)
2. For popup link,I was thinking about using a link to a hidden textbox (for remark) and onmouse click, system will be displayed the textbox which consist of a few information from database and text area for remarking. I, thinking of simplest code for this. Can anyone advise me on this?