How to get the first row corresponding cell value if i change the other rows cell value in kendo child grid

Gowthami

I have kendo child grid. It's having some row. Each row having some cells. If i change the value of a cell other than first row,i have to get the corresponding first row cell value. That means if i change the second row second column value in child grid i have to get the first row second column value in that grid.

I have written change event of each cell in child grid. On change of any cell value this event will fire. In this event i want to achieve the above functionality. Screen shot is attached.

enter image description here

Code for change of cell is

           $('<input  maxlength="9" data-bind="value:' + options.field + '"/>')
                .appendTo(container)
                .kendoNumericTextBox({
                    format: "0.####",
                    decimals: 0,
                    min: 0,
                    spinners: false,
                    change: function (e) {
                        //Here i want to get the first row of this cell value
                    }
                }).off("keydown");
DontVoteMeDown

You have two ways to do that. You can get the value from the cell text or from the dataItem, which I prefer.

In your editor function try this:

function(container, options) {
    var $container = $(container),
        tdIndex = $container.index(),
        $correspondingCell = $container.closest("tbody").find("tr:first td:eq(" + tdIndex + ")"),
        dataItem = grid.dataItem($correspondingCell.parent()),
        correspondingColumnName = options.field;

    // Get from cell's text
    console.log("From Cell", $correspondingCell.text());

    // Get from dataItem
    console.log("From DataItem", dataItem[correspondingColumnName]);

    $('<input  maxlength="9" data-bind="value:' + options.field + '"/>')
        .appendTo($container)
        .kendoNumericTextBox({
            format: "0.####",
            decimals: 0,
            min: 0,
            spinners: false,
            change: function (e) {
                // Now this is the corresponding cell's value from first row
                console.log("First row's corresponding cell value", this);
            }.bind(dataItem[correspondingColumnName]) // <- bind the dataItem's property to the change event
        }).off("keydown");
}

Demo

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

kendo grid How to get a row by field value

From Dev

How can I get the value of a label in a cell

From Dev

How to get the value of formatted cell value of a row in jqgrid

From Dev

How to get grid cell value before update

From Dev

Get value of clicked cell on grid

From Dev

how to get cell click event in kendo grid

From Dev

Get the cell value of a GridView row

From Dev

How do I display Kendo Grid inside Kendo Grid cell?

From Dev

get the value of first cell of last row

From Dev

How can i change color of particular row in datagridview, where a cell value is first timestamp of each day?

From Dev

DataTables - How do I get/set the value of a cell in a row?

From Dev

Get first cell value of each row in table

From Dev

How select row from html table and get the value of the first cell and put it on PHP Session

From Dev

How i can get value of specific cell if row is checked?

From Dev

how to check and change color of cell value in kendo ui grid

From Dev

Update Kendo Grid selected cell value with the value in a Kendo Editor

From Dev

How can I change a wpf Databound grid cell based on the cell value?

From Dev

Excel how to insert below cell value and skip every other row?

From Dev

How to colorize a range in a row depending on a value in the first cell?

From Dev

How can I make a cell in Excel to change colour according to the value of other cell?

From Dev

How to change value of one cell onchange of other cell value in DataGridview

From Dev

Excel VBA: How to paste a value in the first Cell of the last row of a table?

From Dev

Hww to change cell value of grid row

From Dev

I want to change table other cell value when first cell value changed

From Dev

Get rows that include value of input in specific cell, filter by other cell, return other cell values

From Dev

How to set the background colour of the rows in a spreadsheet depending on the value of a cell in the row

From Dev

How to change cell value repeatedly by entering the value in other cell or sheet?

From Dev

How to change background color of cell based on other cell value by VBA

From Dev

How to get the first cell in range which value is equal to a specific value

Related Related

  1. 1

    kendo grid How to get a row by field value

  2. 2

    How can I get the value of a label in a cell

  3. 3

    How to get the value of formatted cell value of a row in jqgrid

  4. 4

    How to get grid cell value before update

  5. 5

    Get value of clicked cell on grid

  6. 6

    how to get cell click event in kendo grid

  7. 7

    Get the cell value of a GridView row

  8. 8

    How do I display Kendo Grid inside Kendo Grid cell?

  9. 9

    get the value of first cell of last row

  10. 10

    How can i change color of particular row in datagridview, where a cell value is first timestamp of each day?

  11. 11

    DataTables - How do I get/set the value of a cell in a row?

  12. 12

    Get first cell value of each row in table

  13. 13

    How select row from html table and get the value of the first cell and put it on PHP Session

  14. 14

    How i can get value of specific cell if row is checked?

  15. 15

    how to check and change color of cell value in kendo ui grid

  16. 16

    Update Kendo Grid selected cell value with the value in a Kendo Editor

  17. 17

    How can I change a wpf Databound grid cell based on the cell value?

  18. 18

    Excel how to insert below cell value and skip every other row?

  19. 19

    How to colorize a range in a row depending on a value in the first cell?

  20. 20

    How can I make a cell in Excel to change colour according to the value of other cell?

  21. 21

    How to change value of one cell onchange of other cell value in DataGridview

  22. 22

    Excel VBA: How to paste a value in the first Cell of the last row of a table?

  23. 23

    Hww to change cell value of grid row

  24. 24

    I want to change table other cell value when first cell value changed

  25. 25

    Get rows that include value of input in specific cell, filter by other cell, return other cell values

  26. 26

    How to set the background colour of the rows in a spreadsheet depending on the value of a cell in the row

  27. 27

    How to change cell value repeatedly by entering the value in other cell or sheet?

  28. 28

    How to change background color of cell based on other cell value by VBA

  29. 29

    How to get the first cell in range which value is equal to a specific value

HotTag

Archive