This is a migrated thread and some comments may be shown as answers.

Value of changed dropdown in KendoGrid column

1 Answer 179 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Sherly
Top achievements
Rank 1
Sherly asked on 01 Aug 2013, 01:03 PM
Hi,

We have a grid with many columns with editor templates defined. We also have many custom validations based on the values of these columns.

eg. One column is a drop down with Status and another column is a datepicker with Date.

When we change the Date we want to check the value of the Status dropdown in the custom validation. How can we do this?

Currently when we change the status from StatusOne to StatusTwo, and then change the date field we need to be able to access the current value of StatusID for that row. But it shows the old value of StatusID (StatusOne) when we try to access it via the grid instead of StatusTwo.

                        var gd = $('#gds').data("kendoGrid");
                        var inputName = input.attr("id");
                        var rowIndex = input.context.rowIndex;
                        var StatusID = gd._data[rowIndex].StatusID;

Please let us know how to access the current value.

Thanks,

Sherly

1 Answer, 1 is accepted

Sort by
0
Greg
Top achievements
Rank 1
answered on 01 Aug 2013, 08:21 PM
var selectedItem = this.dataItem(e.item.index());

var row = this.element.closest("tr");

var grid = $("#gridAuthor").data("kendoGrid");

// get the Grid item

var gridItem = grid.dataItem(row);

//set the new value

gridItem.AuthorName = selectedItem.AuthorName;
Tags
Grid
Asked by
Sherly
Top achievements
Rank 1
Answers by
Greg
Top achievements
Rank 1
Share this question
or