Best method to change grid with different toolbar

3 posts, 1 answers
  1. Andy
    Andy avatar
    22 posts
    Member since:
    Feb 2016

    Posted 22 Mar 2016 Link to this post

    I have a grid that is either "readable" or "modifyable". This depends on the buttons a user clicks. If they click "readable", the grid should NOT display Insert, Edit, Delete buttons. If they click "modifyable", the grid SHOULD display the buttons. Is there a way to change the toolbar buttons without recreating the grid?
  2. Answer
    Stephen
    Stephen avatar
    90 posts
    Member since:
    Jan 2011

    Posted 23 Mar 2016 in reply to Andy Link to this post

    I never use the built-in grid toolbar, I always create my own full Kendo ToolBar and put it into the grid's toolbar area as a template.

    This way, I am in full control of all aspects of the ToolBar and can put whatever I want in it, hide/show/disable/enable buttons as I see fit.

    You may also be able to get a reference to the buttons you want to affect via something like

    $("#myGrid > .k-grid-toolbar > .k-button.k-grid-add")

    and then add/remove display:none or the disabled attribute in response to your readable/modifyable button click.

  3. Andy
    Andy avatar
    22 posts
    Member since:
    Feb 2016

    Posted 23 Mar 2016 in reply to Stephen Link to this post

    This is pretty much what I ended up doing
Back to Top