Add/Edit/Delete button

4 posts, 0 answers
  1. Dan
    Dan avatar
    9 posts
    Member since:
    May 2013

    Posted 16 May 2013 Link to this post

    Hi,

    I am using this command for add, edit and delete in Kendo Grid

    columns.Command(command => { command.Edit(); command.Destroy();
    .ToolBar(toolbar => toolbar.Create())

    I knew I can change the button text by using
    .Text("something")
    .UpdateText("something")
    .CancelText("something")

    My question is how to remove the button text from them.

    I have tried
    .Text("")
    .UpdateText("")
    .CancelText("")

    But it won't work.

    Please help!
  2. Dimiter Madjarov
    Admin
    Dimiter Madjarov avatar
    2284 posts

    Posted 16 May 2013 Link to this post

    Hello Dan,


    The correct way to remove the text from the command buttons is to set it to a single space.
    E.g.
    command.Edit().Text(" "); // space

    You could also add the following CSS in order to preserve the styling. (it's an example for the Edit command).
    E.g.
    .k-grid .k-button.k-grid-edit
    {
        min-width: 0;
        padding-left: 4px;
        padding-right: 4px;
    }
      
    .k-grid .k-button.k-grid-edit .k-icon
    {
        margin: 0;
    }

    I hope this was the information that you were looking for.

     

    Kind regards,
    Dimiter Madjarov
    the Telerik team
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
  3. Dan
    Dan avatar
    9 posts
    Member since:
    May 2013

    Posted 16 May 2013 Link to this post

    Hi Dimiter,

    Actually I did try set it as a single space previously, but the button comes out with icon and a single space behind for add button while edit and delete button are not re-sized as icon width.

    I figured out I need to do something on css to change the width for them after set the command text as space.
    Thanks.


  4. Dimiter Madjarov
    Admin
    Dimiter Madjarov avatar
    2284 posts

    Posted 17 May 2013 Link to this post

    Hi Dan,


    I am glad, that the solution has worked in the current scenario. Please let me know if I could assist you further.

     

    Kind regards,
    Dimiter Madjarov
    the Telerik team
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
Back to Top