This is a migrated thread and some comments may be shown as answers.

Custom command in kendo grid with image only

1 Answer 299 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Jairo
Top achievements
Rank 1
Jairo asked on 17 May 2017, 09:26 PM

Hello,

I am trying to add a custom command to my Kendo Jquery grid and it works well if I just add text. Now I want to replace the text with an icon defined in a class and it works fine as long as there is some text defined but if I remove the command name or text then I get his error:

Uncaught Error: Custom commands should have name specified

So is there a way to define a custom command and "hide" the command text/name so only the image defined in the css class is displayed?

Here is the line where I defined my custom command:

columns: [
            { command: { className: "fa fa-pencil fa-fw", click: editInformation } },

....

]

1 Answer, 1 is accepted

Sort by
0
Accepted
Preslav
Telerik team
answered on 19 May 2017, 10:53 AM
Hello Jairo,

Indeed, a name should be specified for the commands.

A possible workaround is using a name of a single space or the non-breaking space character. For example:
  • text: " "
  • text: " "

Additionally, a runnable example of the above is available in this Dojo: http://dojo.telerik.com/aHIfi

Please, give the above a try and let me know if you require any further assistance.


Regards,
Preslav
Telerik by Progress
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.
Tags
Grid
Asked by
Jairo
Top achievements
Rank 1
Answers by
Preslav
Telerik team
Share this question
or