Akbari
Akbari

Reputation: 2399

Getting Kendo Grid's ID Field WithJavascript

I have a function that I'm going to use with several different Grids. In this function I want to set Grid's Id field which varies in different Grids.

How can I get each grid's ID?

function incId(e) {
    var model = e.model;
    var grid = e.sender;
    //removed 
    model.set(!IDFIELD!, ++Id);
}

Upvotes: 0

Views: 337

Answers (1)

Dion D.
Dion D.

Reputation: 2596

You can use model.idField to get it

model.set(model.idField, ++Id);

Please read its documentation for further investigation

Upvotes: 1

Related Questions