"click" missing from getOptions() on columns

3 posts, 0 answers
  1. Jon
    Jon avatar
    7 posts
    Member since:
    Sep 2017

    Posted 08 Nov 2017 Link to this post

    I am adding a click function to a column containing a button like so

                .Columns(columns =>
                {
                    columns.Command(command =>
                    {
                        command.Custom("customedit").Click("openScanLines").Text("").HtmlAttributes(new { title = "View Scan Details"});
                    }).Width(75);
                })

    We have an option to save the grid options to be loaded a later point.  So we use $("MyGrid").data("kendoGrid").getOptions() to get the options on the grid, Stringify it, and save it to a database  Then we pull that JSON string from the database and use $("MyGrid").data("kendoGrid").setOptions(options) to load them. The problem is the "Click" function is always missing from the $("MyGrid").data("kendoGrid").getOptions(), resulting in the Click function no longer working when the option are then set.  What's the deal?  How can I retain the click function for these columns?

      

  2. Jon
    Jon avatar
    7 posts
    Member since:
    Sep 2017

    Posted 08 Nov 2017 in reply to Jon Link to this post

    EDIT:  it happens during the Stringify
  3. Stefan
    Admin
    Stefan avatar
    2475 posts

    Posted 10 Nov 2017 Link to this post

    Hello, Jon,

    Thank you for the details.

    This is expected scenario which is described in our documentation:

    https://docs.telerik.com/kendo-ui/api/javascript/ui/grid#methods-setOptions

    Also, the following KB article is showing a possible approach how this can be resolved:

    https://docs.telerik.com/kendo-ui/knowledge-base/persist-state-and-function-references 

    I hope this is helpful.

    Regards,
    Stefan
    Progress Telerik
    Try our brand new, jQuery-free Angular components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
Back to Top