How to add configuration options in Javascript

3 posts, 1 answers
  1. PJ Melies
    PJ Melies avatar
    30 posts
    Member since:
    Sep 2008

    Posted 26 Apr Link to this post

    I have a grid that includes the Export to Excel functionality.

    I retrieve the grid options via getOptions() and store them to local storage so that I may later restore those settings by using setOptions().  The  Export to Excel button is not being displayed after I call setOptions() so I'm assuming this is something I need to manually add to the configuration.  However, I'm having a hard time coming up with the syntax.  How do I do this?

    The relevant configuration of the grid looks like this:

    .ToolBar(tools => tools.Excel())
    .Excel(excel => excel
        .ProxyURL(Url.Action("Excel_Export_Save", "Application"))


    Code to populate the grid options looks like this:

    var options = JSON.parse(gridOptions);
    // Now that I have the options how do I add the Excel settings I defined on the
    // grid above before calling setOptions()?

  2. Answer
    Dimiter Madjarov
    Dimiter Madjarov avatar
    2127 posts

    Posted 28 Apr Link to this post

    Hello PJ Melies,

    This issue is expected and the reason is that the toolbar template is built on the server side in this case and not stored in the configuration. The applicable workaround is demonstrated in the following sample project.

    Dimiter Madjarov
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
  3. UI for ASP.NET AJAX banner
  4. PJ Melies
    PJ Melies avatar
    30 posts
    Member since:
    Sep 2008

    Posted 03 May in reply to Dimiter Madjarov Link to this post

    Thank you Dimiter.  This is exactly what I was looking for.
Back to Top