custom icon dissapears after click cancel (inline editing)

4 posts, 0 answers
  1. Daniel
    Daniel avatar
    3 posts
    Member since:
    May 2017

    Posted 08 Jun 2017 Link to this post

    Hi there,

    i have a custom button in the command cell of my grid and bind a custom icon to this button, like in this example.

    dataBound: function (e) {
    e.sender.tbody.find('.k-button.ownIcon').each(function (idx, element)
    {
    $(element).find('span').addClass('k-icon k-i-delete');
    });
    }

    After clicking the cancel Button with "inline" editing the custom icon dissapears. I tried to add the icon a second time when the cancel event is fired, but at this time my custom button is not initialized. Is there any event after this, that i can reach to redraw the icon? 

  2. Viktor Tachev
    Admin
    Viktor Tachev avatar
    2480 posts

    Posted 12 Jun 2017 Link to this post

    Hi Daniel,

    If you would like to customize the icons for custom buttons in the Grid component you can use an approach similar to the one illustrated in the example below. Note that custom class is specified for the buttons via className attribute. Then that CSS class is used to set an icon.


    In case you have a different scenario please send a dojo sample that illustrates the behavior you are observing so we can examine it.


    Regards,
    Viktor Tachev
    Progress Telerik
    Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
  3. Daniel
    Daniel avatar
    3 posts
    Member since:
    May 2017

    Posted 12 Jun 2017 Link to this post

    Hi, 

    http://dojo.telerik.com/AdupA

    I hope this example explains what i want to do. (And I hop the link works :) )

    There you have a custom 'delete' button with a trash icon. The grid edit mode is set to 'inline'. Now if you klick on the edit button und than the cancel button the icon from the delete button disapears.

    Regards,

    Daniel

  4. Daniel
    Daniel avatar
    3 posts
    Member since:
    May 2017

    Posted 13 Jun 2017 Link to this post

    Hey there, 

    i found a solution for this Problem. 

    this workaround worked for me. I simply added the classes for the icons in an empty <span> tag and after this the name of the button.

    {command: [
    {name: "delete"
     text: '<span class="k-icon k-i-delete"></span>Remove',
     click: function(e){
           //code for click function
          }
    }]

     

     

    Regards, 

    Daniel

Back to Top