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

get CustomButton Tag in js

3 Answers 66 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Gusev
Top achievements
Rank 1
Gusev asked on 29 Apr 2013, 01:44 PM
Hello!
I use this
command.Custom("edit").Click("editPlan");
How I can in js method "editplan" get line  in which was clicked my custom button
Because If I use:
var grid = $("#Grid").data("kendoGrid");
 var Id= grid.dataItem(grid.select()).Id;
I can select first element in grid and press button in other element(and I get Id from first element)
I have attached a picture that shows it(error) :

And please answer me, you don't forget to answer me?
http://www.kendoui.com/forums/mvc/grid/clientdetailtemplateid-and-id-of-parent.aspx
I wait 5 days :(

3 Answers, 1 is accepted

Sort by
0
Accepted
Dimo
Telerik team
answered on 30 Apr 2013, 11:10 AM
Hello Grigoriy,

You can use the event arguments to retrieve the table row:

function editPlan(e) {
   var tableRow = $(e.target).closest("tr");
}

Once you have the row, you can retrieve its model using the Grid's dataItem() method, if needed.

You will be contacted by a colleague of mine for further clarifications about the mentioned forum thread.

Greetings,
Dimo
the Telerik team
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
0
Gusev
Top achievements
Rank 1
answered on 06 May 2013, 10:41 AM
Hello!
This works good !
But If I use not custom edit?(I use  .Editable(editable => editable.Mode(GridEditMode.PopUP))
How I can get Parent?(or Id parent)
This example of a bad:
var parent = grid.dataItem(grid.select());
0
Dimo
Telerik team
answered on 06 May 2013, 11:01 AM
Hi Grigoriy,

I suppose the Grid's documentation and the edit event will help you in this case.

Regards,
Dimo
the Telerik team
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
Tags
Grid
Asked by
Gusev
Top achievements
Rank 1
Answers by
Dimo
Telerik team
Gusev
Top achievements
Rank 1
Share this question
or