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

Can't find .Click() on custom commands in grids (in asp.net mvc wrapper) as showed in demo

4 Answers 92 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Erik
Top achievements
Rank 1
Erik asked on 16 Aug 2013, 03:46 PM
Using the asp.net mvc kendoui wrapper,

I cannot use the .click("") command on custom commands as shown off in the web demos...

Any help would be appreciated !

4 Answers, 1 is accepted

Sort by
0
Alexander Popov
Telerik team
answered on 20 Aug 2013, 01:27 PM
Hi Erik,

From the provided information I'm not sure why you cannot use the Click method,
however for convenience I created small example that demonstrates how to do it:

@(Html.Kendo().Grid<Kendo.Mvc.Examples.Models.EmployeeViewModel>()   
    .Name("Grid")
    .Columns(columns => {
        columns.Bound(e => e.FirstName);
        columns.Command(command => command.Custom("CustomCommand").Click("onCustomCommandClick"));
    })
    .DataSource(dataSource => dataSource
        .Read(read => read.Action("CustomCommand_Read", "Grid"))
     )
)
 
<script type="text/javascript"
    function onCustomCommandClick(e) {
        alert("custom command clicked");
    }
</script>

Could you please check the example above and let me know how it differs from your real setup?

Kind Regards,
Alexander Popov
Telerik
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
0
Erik
Top achievements
Rank 1
answered on 20 Aug 2013, 01:36 PM
Hello,

when i try to use Click(), the compiler complains that it cannot be found on any object or any extension method.

I have looked everywhere in the assembly using the object viewer but still it could not be found.

Could you provide me with the full typ name that implements the method ?

Thanks, Erik.
0
Alexander Popov
Telerik team
answered on 20 Aug 2013, 02:40 PM
Hi Erik,


I tried to reproduce the problem locally but to no avail – everything is working as expected on our side. Could you please provide runable project where the issue is reproduced? This would help us pinpoint the exact reason for this behavior.

Kind Regards,
Alexander Popov
Telerik
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
0
Rulin
Top achievements
Rank 1
answered on 10 Oct 2013, 02:08 PM
I have the same issue about function is undefined while running the application. I solved the issue by moving javascript part to the beginning.

Cheers.
Rulin
Tags
Grid
Asked by
Erik
Top achievements
Rank 1
Answers by
Alexander Popov
Telerik team
Erik
Top achievements
Rank 1
Rulin
Top achievements
Rank 1
Share this question
or