Additional Command in the Pageable Bar

5 posts, 0 answers
  1. mgs
    mgs avatar
    163 posts
    Member since:
    Jan 2011

    Posted 01 Mar 2013 Link to this post

    I want my grid to have a "create command". I do know that I can achieve it with the toolbar. However, having a toolbar means having an extra row at the top.

    I prefered if I could add a command to the bottom Pageable Bar. A "create command" would fit nicely right to the "refresh command".

    Is this possible?

    Michael G. Schneider
  2. Vladimir Iliev
    Admin
    Vladimir Iliev avatar
    2172 posts

    Posted 04 Mar 2013 Link to this post

    Hi Michael,

     
    Adding such create command is not supported out of the box, however you can use jQuery to add such button on document ready event:

    Add the button next to the refresh button (after the grid is loaded):

    $("#grid .k-pager-refresh").before("<a href='javascript: void(0)' onclick='addRecord()' class='pagerAddRecord'>Add</a>");

    addRecord function:
    function addRecord()
    {
        var grid = $(event.srcElement).closest(".k-grid").data("kendoGrid");
        grid.addRow();
    }

    example CSS styles:
    .pagerAddRecord {
        float: right;
        margin-right: 6px;
        padding: 3px;
        width: 16px;
        height: 16px;
    }

    Kind Regards,
    Vladimir Iliev
    the Telerik team
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
  3. Kendo UI is VS 2017 Ready
  4. mgs
    mgs avatar
    163 posts
    Member since:
    Jan 2011

    Posted 04 Mar 2013 Link to this post

    Hello Vladimir,

    thanks a lot. It works perfectly.

    Maybe you can think about integrating "adding buttons to the pageable bar" into Kendo. I do not like the toolbar, as it means wasted vertical space, if there are only one or two commands.

    Michael G. Schneider
  5. Vladimir Iliev
    Admin
    Vladimir Iliev avatar
    2172 posts

    Posted 04 Mar 2013 Link to this post

    Hi Michael,

     
    I would suggest to share your idea at Kendo UserVoice to allow other users vote for it. Most voted ideas are included in next KendoUI releases.

    Kind Regards,
    Vladimir Iliev
    the Telerik team
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
  6. mgs
    mgs avatar
    163 posts
    Member since:
    Jan 2011

    Posted 04 Mar 2013 Link to this post

    Hello Vladimir,

    ok, I have done so. It is here.

    Michael G. Schneider
Back to Top
Kendo UI is VS 2017 Ready