如何汇总JSON总结果?

i have this script to take data from JSON Results, also this script filter results by ID

  $(document).ready(function () {
        //Call EmpDetails jsonResult Method
        $.getJSON("/smetkis/getTrosokList",
        function (json) {
            var tr;
              for (var i = 0; i < json.length; i++) {
                if (json[i].skID == '@Html.DisplayFor(model => model.smID)') {
                   tr = $('<tr />');
                    tr.append("<td >" + json[i].Artikal + "</td>");
                    tr.append("<td>" + json[i].kol + "</td>");
                    tr.append("<td>" + json[i].cena + "</td>");
                    tr.append($('<td class="vkupno1">' + json[i].vkupnot + '</td>'));
                    $('table').append(tr);
                }
            }
    });
    });

Also i have this script sor SUM Of column with class vkupno1, but not understand the results from cell.

 $(document).ready(function () {
    colSum();
});
function colSum() {
    var sum = 0;
        $(".vkupno1").each(function () {
        sum += parseFloat($(this).text());
    });
    $('#result').html((sum).toFixed(2).replace(/(\d)(?=(\d{6})+(?!\d))/g, "$1.") + " €");
}

How to sum (json[i].vkupnot)-value or cell classed "vkupno1"

here is JSON Results:

[{"smetki":null,"trId":1,"skID":1,"Artikal":"gdfgsdgfdg","kol":4.00,"cena":4.00,"vkupnot":16.00},{"smetki":null,"trId":4,"skID":4,"Artikal":"kjhkjhkjhk","kol":7.00,"cena":7.00,"vkupnot":47.00},{"smetki":null,"trId":5,"skID":4,"Artikal":"lkjlkjlk","kol":8.00,"cena":8.00,"vkupnot":64.00},{"smetki":null,"trId":6,"skID":5,"Artikal":"gdfg","kol":5.00,"cena":5.00,"vkupnot":25.00},{"smetki":null,"trId":7,"skID":6,"Artikal":"gdfg","kol":5.00,"cena":5.00,"vkupnot":25.00},{"smetki":null,"trId":8,"skID":7,"Artikal":"gagaggag","kol":5.00,"cena":55.00,"vkupnot":275.00},{"smetki":null,"trId":9,"skID":7,"Artikal":"ggg","kol":4.00,"cena":65.00,"vkupnot":260.00}]

You can add the values from response itself without reading from DOM.

Try this

$(document).ready(function() {
  //Call EmpDetails jsonResult Method
  $.getJSON("/smetkis/getTrosokList",
    function(json) {
      var tr;
      var sum = 0; //initialising sum
      for (var i = 0; i < json.length; i++) {
        if (json[i].skID == '@Html.DisplayFor(model => model.smID)') {
          tr = $('<tr />');
          tr.append("<td >" + json[i].Artikal + "</td>");
          tr.append("<td>" + json[i].kol + "</td>");
          tr.append("<td>" + json[i].cena + "</td>");
          tr.append($('<td class="vkupno1">' + json[i].vkupnot + '</td>'));
          $('table').append(tr);
          sum += parseFloat(json[i].vkupnot); //adding directly from the response
        }
      }
      $('#result').html((sum).toFixed(2).replace(/(\d)(?=(\d{6})+(?!\d))/g, "$1.") + " €");
    });
});

And you need to wait for the response before reading the dynamically created DOM elements.