locked
All empty comment text is filled with the value '0.00' in js Datatble RRS feed

  • Question

  • User-1355965324 posted

    I am using js  data table for  employee  daily attendance. There  is one column comment. When the page is loaded for daily attendance,  and comment column is empty , it is filled with the value '0.00' . I  am trying to change its  value from '0.00' to ' '.  But I dont know  where the value coming from . I debugged all the ways I could not find.  The ALL  empty text value is filled with '0.00' . Please  I am looking for the help from expertise  how  can find  where the  empty  text area of the comment column  is filled with '0.00' in that HTML.

    I apologise if I am asking stupid question

    <table id="attendance" class="table table-bordered table-striped text-center dataTable no-footer" role="grid" aria-describedby="attendance_info" style="width: 0px;"><thead class="row my-sticky-header">
                                    <tr role="row"><td rowspan="2" class="checker sorting_disabled" colspan="1" style="width: 0px;">SNo</td><td rowspan="2" class="checker sorting_disabled" colspan="1" style="width: 0px;">Employee</td><td rowspan="2" class="checker sorting_disabled" colspan="1" style="width: 0px;">In Time</td><td rowspan="2" class="checker sorting_disabled" colspan="1" style="width: 0px;">Out Time </td><td rowspan="2" class="checker sorting_disabled" colspan="1" style="width: 0px;">Break Hrs</td><td rowspan="2" class="checker sorting_disabled" colspan="1" style="width: 0px;">Net Hrs</td><td rowspan="2" class="checker sorting_disabled" colspan="1" style="width: 0px;">In Time</td><td rowspan="2" class="checker sorting_disabled" colspan="1" style="width: 0px;">Out Time </td><td colspan="2" rowspan="1">Normal Attendance </td><td colspan="2" rowspan="1">
                                            Scheduled DayOff
                                        </td><td colspan="2" class="hidden" rowspan="1">DayOff Re.funeral</td><td colspan="2" rowspan="1">Sick</td><td colspan="2" rowspan="1">Holiday</td><td colspan="2" rowspan="1">Maternity Paternity</td><td colspan="2" rowspan="1">Time off</td><td rowspan="2" class="checker sorting_disabled" colspan="1" style="width: 0px;">Sal Ded</td><td rowspan="2" class="checker sorting_disabled" colspan="1" style="width: 0px;">Extra Time</td><td rowspan="2" class="checker sorting_disabled" colspan="1" style="width: 0px;">Comment</td></tr>
    
                                    <tr role="row"><td class="checker sorting_disabled" rowspan="1" colspan="1" style="width: 0px;"></td><td class="checker sorting_disabled" rowspan="1" colspan="1" style="width: 0px;">Time</td><td class="checker sorting_disabled" rowspan="1" colspan="1" style="width: 0px;"></td><td class="checker sorting_disabled" rowspan="1" colspan="1" style="width: 0px;">Time</td><td class="checker hidden sorting_disabled" rowspan="1" colspan="1" style="width: 0px;"></td><td class="checker hidden sorting_disabled" rowspan="1" colspan="1" style="width: 0px;">Time</td><td class="checker sorting_disabled" rowspan="1" colspan="1" style="width: 0px;"></td><td class="checker sorting_disabled" rowspan="1" colspan="1" style="width: 0px;">Time</td><td class="checker sorting_disabled" rowspan="1" colspan="1" style="width: 0px;"></td><td class="checker sorting_disabled" rowspan="1" colspan="1" style="width: 0px;">Time</td><td class="checker sorting_disabled" rowspan="1" colspan="1" style="width: 0px;"></td><td class="checker sorting_disabled" rowspan="1" colspan="1" style="width: 0px;">Time</td><td class="checker sorting_disabled" rowspan="1" colspan="1" style="width: 0px;"></td><td class="checker sorting_disabled" rowspan="1" colspan="1" style="width: 0px;">Time</td></tr>
                                </thead>
                                
                                <thead class="row ">
                                    <tr>
                                        <td rowspan="2" class="checker">SNo</td>
                                        <td rowspan="2" class="checker">Employee</td>
                                        <td rowspan="2" class="checker">In Time</td>
                                        <td rowspan="2" class="checker">Out Time </td>
                                        <td rowspan="2" class="checker">Break Hrs</td>
                                        <td rowspan="2" class="checker">Net Hrs</td>
                                        <td rowspan="2" class="checker">Clock In</td>
                                        <td rowspan="2" class="checker">Clock Out</td>
                                        <td colspan="2">Normal Attendance </td>
                                        <td colspan="2">
                                            Scheduled DayOff
                                        </td>
                                        <td colspan="2" class="hidden">DayOff Re.funeral</td>
                                        <td colspan="2">Sick</td>
                                        <td colspan="2">Holiday</td>
                                        <td colspan="2">Maternity Paternity</td>
                                        <td colspan="2">Time off</td>
                                        <td rowspan="2" class="checker">Sal Ded</td>
                                        <td rowspan="2" class="checker">Extra Time</td>
                                        <td rowspan="2" class="checker">Comment</td>
                                    </tr>
    
                                    <tr>
                                        <td class="checker"></td>
                                        <td class="checker">Time</td>
                                        <td class="checker"></td>
                                        <td class="checker">Time</td>
                                        <td class="checker hidden"></td>
                                        <td class="checker hidden">Time</td>
                                        <td class="checker"></td>
                                        <td class="checker">Time</td>
                                        <td class="checker"></td>
                                        <td class="checker">Time</td>
                                        <td class="checker"></td>
                                        <td class="checker">Time</td>
                                        <td class="checker"></td>
                                        <td class="checker">Time</td>
                                    </tr>
                                </thead>
    
                                <tbody>
    
                                                    
                                <tr id="0" role="row" class="odd">
                                                        <td>1<input type="hidden" data-val="true" data-val-required="The LogID field is required." id="attendanceLogList_0__LogID" name="attendanceLogList[0].LogID" value="0"></td>
                                                        <td>DEREK JOHN<input type="hidden" data-val="true" data-val-required="The EmployeeID field is required." id="attendanceLogList_0__EmployeeID" name="attendanceLogList[0].EmployeeID" value="133"></td>
                                                        <td>8.30<input type="hidden" data-val="true" data-val-required="The DepotNo field is required." id="attendanceLogList_0__DepotNo" name="attendanceLogList[0].DepotNo" value="13"></td>
                                                        <td>17.00<input type="hidden" data-val="true" data-val-required="The DepartmentID field is required." id="attendanceLogList_0__DepartmentID" name="attendanceLogList[0].DepartmentID" value="1"></td>
                                                        <td>0.45</td>
                                                        <td><input type="text" class="borderless-text" data-val="true" data-val-number="The field NetHrs must be a number." data-val-required="The NetHrs field is required." id="attendanceLogList_0__NetHrs" name="attendanceLogList[0].NetHrs" value="7.45"></td>
                                                        <td><a href="#" data-pk="ClockIn" class="editable editable-click">00:00:00</a><input type="hidden" id="attendanceLogList_0__ClockedIn" name="attendanceLogList[0].ClockedIn" value="00:00:00"></td>
                                                        <td><a href="#" data-pk="ClockOut" class="editable editable-click">00:00:00</a><input type="hidden" id="attendanceLogList_0__ClockedOut" name="attendanceLogList[0].ClockedOut" value="00:00:00"></td>
                                                        <td><input type="checkbox" value="true" data-tag="NormalHrs" data-val="true" data-val-required="The IsNormalAttendance field is required." id="attendanceLogList_0__IsNormalAttendance" name="attendanceLogList[0].IsNormalAttendance"> <input type="hidden" value="false" id="attendanceLogList_0__IsNormalAttendance" name="attendanceLogList[0].IsNormalAttendance"> </td>
                                                        <td><a href="#" data-pk="NormalHrs" class="editable editable-click">0.00</a><input type="hidden" class="bros" data-val="true" data-val-number="The field NormalHrs must be a number." data-val-required="The NormalHrs field is required." id="attendanceLogList_0__NormalHrs" name="attendanceLogList[0].NormalHrs" value="0.00"></td>
                                                        <td><input type="checkbox" value="true" disabled="" data-tag="DayOffHrs" data-val="true" data-val-required="The IsDayOffMarked field is required." id="attendanceLogList_0__IsDayOffMarked" name="attendanceLogList[0].IsDayOffMarked"> <input type="hidden" value="false" id="attendanceLogList_0__IsDayOffMarked" name="attendanceLogList[0].IsDayOffMarked"> </td>
                                                        <td><div class="disabled">0.00</div><input type="hidden" class="bros" data-val="true" data-val-number="The field DayOffHrs must be a number." data-val-required="The DayOffHrs field is required." id="attendanceLogList_0__DayOffHrs" name="attendanceLogList[0].DayOffHrs" value="0.00"></td>
                                                        <td class="hidden"><input type="checkbox" value="true" data-tag="FuneralHrs" data-val="true" data-val-required="The IsFuneralDayOff field is required." id="attendanceLogList_0__IsFuneralDayOff" name="attendanceLogList[0].IsFuneralDayOff"><input type="hidden" value="false" id="attendanceLogList_0__IsFuneralDayOff" name="attendanceLogList[0].IsFuneralDayOff"> </td>
                                                        <td class="hidden"><a href="#" data-pk="FuneralHrs" class="editable editable-click">0.00</a><input type="hidden" class="bros" data-val="true" data-val-number="The field FuneralHrs must be a number." data-val-required="The FuneralHrs field is required." id="attendanceLogList_0__FuneralHrs" name="attendanceLogList[0].FuneralHrs" value="0.00"></td>
                                                        <td><input type="checkbox" value="true" data-tag="SickHrs" data-val="true" data-val-required="The IsSickMarked field is required." id="attendanceLogList_0__IsSickMarked" name="attendanceLogList[0].IsSickMarked"> <input type="hidden" value="false" id="attendanceLogList_0__IsSickMarked" name="attendanceLogList[0].IsSickMarked"></td>
                                                        <td><a href="#" data-pk="SickHrs" class="editable editable-click">0.00</a><input type="hidden" class="bros" data-val="true" data-val-number="The field SickHrs must be a number." data-val-required="The SickHrs field is required." id="attendanceLogList_0__SickHrs" name="attendanceLogList[0].SickHrs" value="0.00"></td>
                                                        <td><input type="checkbox" value="true" data-tag="HolidayHrs" data-val="true" data-val-required="The IsHolidayMarked field is required." id="attendanceLogList_0__IsHolidayMarked" name="attendanceLogList[0].IsHolidayMarked"><input type="hidden" value="false" id="attendanceLogList_0__IsHolidayMarked" name="attendanceLogList[0].IsHolidayMarked"> </td>
                                                        <td><a href="#" data-pk="HolidayHrs" class="editable editable-click">0.00</a><input type="hidden" class="bros" data-val="true" data-val-number="The field HolidayHrs must be a number." data-val-required="The HolidayHrs field is required." id="attendanceLogList_0__HolidayHrs" name="attendanceLogList[0].HolidayHrs" value="0.00"></td>
                                                        <td><input type="checkbox" value="true" data-tag="MaternityHrs" data-val="true" data-val-required="The IsMaternityLeave field is required." id="attendanceLogList_0__IsMaternityLeave" name="attendanceLogList[0].IsMaternityLeave"><input type="hidden" value="false" id="attendanceLogList_0__IsMaternityLeave" name="attendanceLogList[0].IsMaternityLeave"> </td>
                                                        <td><a href="#" data-pk="MaternityHrs" class="editable editable-click">0.00</a><input type="hidden" class="bros" data-val="true" data-val-number="The field MaternityHrs must be a number." data-val-required="The MaternityHrs field is required." id="attendanceLogList_0__MaternityHrs" name="attendanceLogList[0].MaternityHrs" value="0.00"></td>
                                                        <td><input type="checkbox" value="true" data-tag="TimeOffHrs" data-val="true" data-val-required="The IsTimeOff field is required." id="attendanceLogList_0__IsTimeOff" name="attendanceLogList[0].IsTimeOff"><input type="hidden" value="false" id="attendanceLogList_0__IsTimeOff" name="attendanceLogList[0].IsTimeOff"> </td>
                                                        <td><a href="#" data-pk="TimeOffHrs" class="editable editable-click">0.00</a><input type="hidden" class="bros" data-val="true" data-val-number="The field TimeOffHrs must be a number." data-val-required="The TimeOffHrs field is required." id="attendanceLogList_0__TimeOffHrs" name="attendanceLogList[0].TimeOffHrs" value="0.00"></td>
                                                        <td><input type="checkbox" value="true" data-val="true" data-val-required="The IsDeductionMarked field is required." id="attendanceLogList_0__IsDeductionMarked" name="attendanceLogList[0].IsDeductionMarked"><input type="hidden" value="false" id="attendanceLogList_0__IsDeductionMarked" name="attendanceLogList[0].IsDeductionMarked"> </td>
                                                        <td><a href="#" data-pk="ExtraTimeHrs" class="editable editable-click">0.00</a><input type="hidden" class="bros" data-val="true" data-val-number="The field ExtraTimeHrs must be a number." data-val-required="The ExtraTimeHrs field is required." id="attendanceLogList_0__ExtraTimeHrs" name="attendanceLogList[0].ExtraTimeHrs" value="0.00"></td>
                                                        <td class="text"><a href="#" data-pk="Remark" class="editable editable-click editable-empty">0.00</a><input type="hidden" id="attendanceLogList_0__Remark" name="attendanceLogList[0].Remark" value=""></td>
                                                    </tr></tbody>
    
    
                            </table>
    
    

    Thursday, March 21, 2019 10:47 AM

Answers

  • User839733648 posted

    Hi polachan,

    I suggest that you could use F12 developer tools to check where the value is.

    And I've found that the following is the code of comment.

    <td class="text"><a href="#" data-pk="Remark" class="editable editable-click editable-empty">0.00</a><input type="hidden" id="attendanceLogList_0__Remark" name="attendanceLogList[0].Remark" value=""></td>

    The value 0.00 has affected the result. You just have to modify it and then you will achieve your requirement.

    Best Regards,

    Jenifer

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Friday, March 22, 2019 2:46 AM

All replies

  • User839733648 posted

    Hi polachan,

    I suggest that you could use F12 developer tools to check where the value is.

    And I've found that the following is the code of comment.

    <td class="text"><a href="#" data-pk="Remark" class="editable editable-click editable-empty">0.00</a><input type="hidden" id="attendanceLogList_0__Remark" name="attendanceLogList[0].Remark" value=""></td>

    The value 0.00 has affected the result. You just have to modify it and then you will achieve your requirement.

    Best Regards,

    Jenifer

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Friday, March 22, 2019 2:46 AM
  • User-1038772411 posted

    You Can Handle Null Value Of datatable column

    foreach(DataRow row in table.Rows)
    {
        object value = row["ColumnName"];
        if (value == DBNull.Value)
            // do something
        else
            // do something else
    }

    For More Understanding Please Refer This link

    Friday, March 22, 2019 12:21 PM