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

Child grid custom command button

1 Answer 126 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Ahmad Gunawan
Top achievements
Rank 1
Ahmad Gunawan asked on 16 Jul 2014, 06:48 AM
Hello,

I have a question based on my current situation, I have a grid with ClientDetail / Child grid inside of it. In my parent grid there is a custom command button, let say... "columns.Command(command => { command.Custom("Edit").Click("showEdit"); command.Destroy(); }).Width(160);" and also i had my custom command button as well in my child grid, let say "columns.Command(command => { command.Custom("Edit").Click("showSubEdit"); command.Destroy(); }).Width(160);"

Those 2 custom command should call different function which is "showEdit" & "showSubEdit". The problem is, every time custom command in child grid triggered, it always calls its parent's function which is "showEdit", however the child grid should call "showSubEdit".

Is there something i missed ?

NB :
function showEdit(e) {
...
}
function showSubEdit(e) {
...
}


1 Answer, 1 is accepted

Sort by
0
Rosen
Telerik team
answered on 17 Jul 2014, 01:32 PM
Hello Ahmad,

The behavior you are observing is due to the way the custom command click is handled. In order to overcome this you will need to stop the event propagation of the child grid click. Similar to the following:

function showSubEdit(e) {
    e.stopPropagation();
    //...
}


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