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

Kendo UI Grid custom command bug

11 Answers 330 Views
Grid
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
S
Top achievements
Rank 1
S asked on 06 Aug 2012, 03:25 PM
There seems to be bug on Grid when using custom command. I am looking into the following example:
http://demos.kendoui.com/web/grid/custom-command.html 

But, when I specify the text for the command button ("Details") to "New Task", it won't work.
Further digging shows me that the text can't contain space. The text is somehow appended to class attribute of that element, causing jquery selector not working on that element.

11 Answers, 1 is accepted

Sort by
0
Rosen
Telerik team
answered on 07 Aug 2012, 07:27 AM
Hi,

Indeed, in current official version you of KendoUI the command name cannot contain spaces. Thus, you should use the command's Text to set the text, which does support spaces.

Regards,
Rosen
the Telerik team
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
0
Matt
Top achievements
Rank 1
answered on 07 Aug 2012, 03:12 PM
>> Thus, you should use the command's Text to set the text, which does support spaces. 

What do you mean?

command: { text: "s p a c e s", click: function } 

doesn't work. What is the "command's Text?"

0
Rosen
Telerik team
answered on 07 Aug 2012, 03:26 PM
Hi Matt,

You should set both the name and the text:

{ name: "MyCommand", text: "My Command Text" }

Regards,
Rosen
the Telerik team
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
0
David
Top achievements
Rank 1
answered on 22 Aug 2012, 03:55 PM
I thought I found the same bug, but removing spaces from the command text and setting a spaceless name value both fail to convince the command button to execute the click function.
$("#history_grid").kendoGrid({
columns: [
{ field: "type", title: "Document Type" },
{ field: "target", title: "To/From" },
{ field: "date_received", title: "Date Sent/Received" },
{ field: "path", title: " ", template: '<a href="${ path }">Link to file</a>', width: "80px" },
{ command: { name: "ViewFile", text: "View File", click: viewDoc }, title: " ", width: "100px" }
],
scrollable: true,
autobind: false,
dataSource: history_datasource
});
 
function viewDoc(e) {
e.preventDefault();
var path = this.dataItem($(e.currentTarget).closest("tr"));
alert(path);
};

In brief: clicking the command button does nothing.
0
Dennis
Top achievements
Rank 1
answered on 23 Aug 2012, 06:56 PM
It would be really nice to get more feedback from the Kendo team on this, i have the same problem as the last poster, it's not the name bug and nothing happens when I click. I already posted a thread, but I got no answer. I'm losing days here thinking something is wrong, and I'm making a mistake, when in truth I might be dealing with a bug or wrongly documented demos. I get this problem all the time with Kendo, and although it seems a great product, this kind of support will make me drop it. 
0
David
Top achievements
Rank 1
answered on 23 Aug 2012, 07:04 PM
I've had great support from Telerik. Hang in there.
0
David
Top achievements
Rank 1
answered on 24 Aug 2012, 08:01 PM
So any update? I also run into the weird bug, even I have removed the space in my text, the click is not firing.
{ command: [{ text: "showDetails", click: showDetails }], title: "&nbsp;", width: "100px", filterable: false }
0
David
Top achievements
Rank 1
answered on 24 Aug 2012, 08:45 PM
Nothing. Somebody put in a ticket?
0
Carlos
Top achievements
Rank 1
answered on 11 Sep 2012, 01:11 PM
I had this issue, so I resolved it assigning the name to the button.
columns: [
            { command: { name: "cmdLoadRows", text: "Load Rows", click: LoadX }, title: "", width: "100px" },
            { field: "Name", title: "Partner" },
            { field: "DocNum", width: "150px" },
            { field: "SalesPerson", title: "Sales Person", width: "250px" },
            { field: "FSD", title: "Fact Ship Date", width: "150px", format: "{0:MM/dd/yyyy}" }
            ],

0
David
Top achievements
Rank 1
answered on 11 Sep 2012, 09:20 PM
I don't see how that's any different than what we've already been doing.
0
Raymond
Top achievements
Rank 1
answered on 26 Sep 2013, 01:21 AM
I was having a similar issue and found this thread. I was not defining a name and had set my text to '...' which caused a javascript error because it didn't know what to do with a.k-grid-...  

Setting a name (without spaces) fixed the problem for me.
Tags
Grid
Asked by
S
Top achievements
Rank 1
Answers by
Rosen
Telerik team
Matt
Top achievements
Rank 1
David
Top achievements
Rank 1
Dennis
Top achievements
Rank 1
David
Top achievements
Rank 1
Carlos
Top achievements
Rank 1
Raymond
Top achievements
Rank 1
Share this question
or