MattyP
MattyP

Reputation: 35

Getting edited row cell value after update to grid. JsGrid

From what I have looked through I cannot find exactly how to do this.

I have tried my hand at editTemplate, itemTemplate and trying to store the Promise returned from $("#jsGrid" + i).jsGrid("updateItem");.

So in short what I want to do is have a list of which values have been updated in my grid so I can then send these back to the DB to update them there. But I do need a little more than just the row cell changed value, I also need the other values from that row. So even getting which rows that have been updated would work, and may work better.

Here is the field that I am trying to do this on:

var x = {
        name: productList[i],
        type: "number",
        align: "center",
        //readOnly: true,
        width: 100,
        // editTemplate: function(item) {
        //     updated.push(item);
        // }
        // itemTemplate: function(value, item) {
        //     return $("<input>").attr("type", "number").attr("updatedValue", value || item.updatedValue)
        //     .on("change", function() {
        //         item.updatedValue = $(this).is(":updatedValue");
        //     });
        // }
    };

Upvotes: 0

Views: 1636

Answers (1)

MattyP
MattyP

Reputation: 35

Turns out it was simple and I was overlooking some things and my understanding was not quite fully there. Solution:

onItemUpdated: function(args) {
            updated.push(args.item);
        }

Upvotes: 1

Related Questions