JQgrid checkbox onclick update database

前端 未结 3 1101
北恋
北恋 2020-11-27 07:42

I have a checkbox column in my JqGrid which get loaded from DB, so it is either checked or not checked when it is loaded.

What i want is : If checkbox is being check

3条回答
  •  我在风中等你
    2020-11-27 08:03

    To change values of other column based on click of checkbox

    var weightedAvgPriceIndex = getColumnIndexByName($(this), 'WeightedAveragePrice'),
        rows = this.rows,
        i,
        c = rows.length;
    
    for (i = 1; i < c; i += 1) {
        $(('input[type="checkbox"]'),rows[i].cells[iCol]).click(function (e) {
          var id = $(e.target).closest('tr')[0].id;
          isChecked = $(e.target).is(':checked');
          var x = $('#' + id + ' td:eq(' + weightedAvgPriceIndex + ')').text();
          $('#' + id + ' td:eq(' + weightedAvgPriceIndex + ')').text(Math.abs(x) + 10);
        });
    }
    

提交回复
热议问题