Grid custom command does not find javascript function

2 posts, 0 answers
  1. Derek
    Derek avatar
    8 posts
    Member since:
    Mar 2019

    Posted 25 Jun 2019 Link to this post


    I have based the following code on Grid / Custom command

        Columns(columns =>
            columns.Command(command => {
                command.Custom("Edit Details").Click("EditDetails");
        .HtmlAttributes(new { style = "height: 600px" })
        function EditDetails(e) {

    When I run the code I get the following error in the Developer Console(Edge & Chrome)
    Uncaught ReferenceError: EditDetails is not defined

    I have been unable to find the problem, any suggestions?

    Is there a way that i can call a controller method without going through javascript?



  2. Marin Bratanov
    Marin Bratanov avatar
    5704 posts

    Posted 26 Jun 2019 Link to this post

    Hi Derek,

    Try moving the function declaration above the grid.

    On redirecting to an action - I an think of two easy ways:

    • use JS and call window.location.href = "mycontorller/myaction/someparam" where the event arguments of the custom command handler can be used to get the current row data item and use its fields in constructing the url
    • use the ClientTemplate of a column and place an anchor there that will point to the desired url - in a similar fashion, build its parameters with the data that comes from the model


    Marin Bratanov
    Progress Telerik
    Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
Back to Top