Click here to Skip to main content
15,798,280 members
Home / Discussions / JavaScript
   

JavaScript

 
AnswerRe: Beginner 5 Project idea Pin
Scott Butchers19-Mar-21 4:26
Scott Butchers19-Mar-21 4:26 
QuestionHow to navigate to next search term in angular with up and down arrow buttons? Pin
shruti devurkar18-Feb-21 6:54
shruti devurkar18-Feb-21 6:54 
SuggestionRe: How to navigate to next search term in angular with up and down arrow buttons? Pin
CHill6018-Feb-21 6:55
mveCHill6018-Feb-21 6:55 
QuestionTrying to read a value that is coming from html() function from Table Cell Id Pin
simpledeveloper17-Feb-21 20:42
simpledeveloper17-Feb-21 20:42 
AnswerRe: Trying to read a value that is coming from html() function from Table Cell Id Pin
Richard MacCutchan17-Feb-21 22:38
mveRichard MacCutchan17-Feb-21 22:38 
GeneralRe: Trying to read a value that is coming from html() function from Table Cell Id Pin
simpledeveloper17-Feb-21 22:59
simpledeveloper17-Feb-21 22:59 
GeneralRe: Trying to read a value that is coming from html() function from Table Cell Id Pin
Richard MacCutchan17-Feb-21 23:45
mveRichard MacCutchan17-Feb-21 23:45 
GeneralRe: Trying to read a value that is coming from html() function from Table Cell Id Pin
simpledeveloper17-Feb-21 23:47
simpledeveloper17-Feb-21 23:47 
No totalRemaining is also printing as 5000.00, but when I am trying to add them its retuning NaN

My total function as below:
saveTotalPenalty: function (paramdata, id, indx) {
    var m = this.get('model');

    let totalRemaining = m.PaymentPlan.TotalAmount;

    this.penaltyPerUnit = $(this.boxId).val() / paramdata.Cnt;
    this.penaltyPerUnit = this.penaltyPerUnit.toFixed(2);

    if ((m.PaymentPlan.ViolationsUniquePenaltyApplied != null) && (m.PaymentPlan.ViolationsUniquePenaltyApplied != 'undefined'))
        for (let i = 0; i < m.PaymentPlan.ViolationsUniquePenaltyApplied.length; i++) {
            let t = '#' + 'td0' + i;
            let a = parseFloat($(t).html().valueOf());

            console.log('a');
            console.log(a);
            totalRemaining = parseFloat(totalRemaining) - a;
            console.log('totalRemaining');
            console.log(totalRemaining);
        }

    if ((m.PaymentPlan.ViolationsUniquePenaltyNotApplied != null) && (m.PaymentPlan.ViolationsUniquePenaltyNotApplied != 'undefined'))
        for (let i = 0; i < m.PaymentPlan.ViolationsUniquePenaltyNotApplied.length; i++) {
            let t = '#' + 'txt' + i;
            totalRemaining = totalRemaining - $(t).val();
        }

    totalRemaining = totalRemaining.toFixed(2);
    $('#thTotalRemaining').html(totalRemaining)

    if ((paramdata.PenaltyAssessed == null) || (paramdata.PenaltyAssessed == 0) || (paramdata.PenaltyAssessed == 'undefined') || isNaN(paramdata.PenaltyAssessed))
        return;

    $('#td' + indx).html(this.penaltyPerUnit);
    var scope = this;
    var data = {
        violationPenaltyAdjustment: paramdata,
        CaseId: id,
        PenaltyAssessed: paramdata.PenaltyAssessed
    };

    scope.api('Paymentxxxn/AddTotalxxxx').post(data).then(function (response) {
        //scope.set('model', response.Data.plan);
        toastr.success("Payment added");
    }, function (error) {
        Ember.set(payment, "isLoading", false);
        toastr.error("Error adding payment plan item");
    });
}


modified 18-Feb-21 5:06am.

GeneralRe: Trying to read a value that is coming from html() function from Table Cell Id Pin
Richard MacCutchan18-Feb-21 0:11
mveRichard MacCutchan18-Feb-21 0:11 
GeneralRe: Trying to read a value that is coming from html() function from Table Cell Id Pin
simpledeveloper18-Feb-21 8:08
simpledeveloper18-Feb-21 8:08 
GeneralRe: Trying to read a value that is coming from html() function from Table Cell Id Pin
Richard MacCutchan18-Feb-21 22:19
mveRichard MacCutchan18-Feb-21 22:19 
QuestionSending Blob (webm) from client to server. Pin
Rayj201010-Feb-21 13:38
Rayj201010-Feb-21 13:38 
Questionconnecting javascript or jquery with node.js backend APIs Pin
Member 141035569-Feb-21 11:25
Member 141035569-Feb-21 11:25 
QuestionEdit only a part of text inserted in a "select"... Pin
Member 150649449-Feb-21 0:46
Member 150649449-Feb-21 0:46 
QuestionWhy can't execute the code to the secondary window in javascript? Pin
JacksonSteel5-Feb-21 15:54
JacksonSteel5-Feb-21 15:54 
AnswerRe: Why can't execute the code to the secondary window in javascript? Pin
Richard Deeming7-Feb-21 23:06
mveRichard Deeming7-Feb-21 23:06 
QuestionUse radiobutton and checkbox together Pin
Member 150649444-Feb-21 14:24
Member 150649444-Feb-21 14:24 
AnswerRe: Use radiobutton and checkbox together Pin
Richard MacCutchan4-Feb-21 23:52
mveRichard MacCutchan4-Feb-21 23:52 
GeneralRe: Use radiobutton and checkbox together Pin
Member 150649445-Feb-21 0:57
Member 150649445-Feb-21 0:57 
GeneralRe: Use radiobutton and checkbox together Pin
Richard MacCutchan5-Feb-21 0:59
mveRichard MacCutchan5-Feb-21 0:59 
GeneralRe: Use radiobutton and checkbox together Pin
Richard Deeming5-Feb-21 1:47
mveRichard Deeming5-Feb-21 1:47 
GeneralRe: Use radiobutton and checkbox together Pin
Richard MacCutchan5-Feb-21 2:01
mveRichard MacCutchan5-Feb-21 2:01 
AnswerRe: Use radiobutton and checkbox together Pin
Richard Deeming5-Feb-21 2:17
mveRichard Deeming5-Feb-21 2:17 
GeneralRe: Use radiobutton and checkbox together Pin
Member 150649445-Feb-21 2:44
Member 150649445-Feb-21 2:44 
QuestionHow to use decimals (0.01) in Javascript function Pin
Member 150641013-Feb-21 19:17
Member 150641013-Feb-21 19:17 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.