Kendo UI Grid custom command bug

Thread is closed for posting
12 posts, 0 answers
  1. S
    S avatar
    15 posts
    Member since:
    Apr 2012

    Posted 06 Aug 2012 Link to this post

    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.

  2. Rosen
    Admin
    Rosen avatar
    2641 posts
    Member since:
    Sep 2012

    Posted 07 Aug 2012 Link to this post

    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!

  3. Matt
    Matt avatar
    16 posts
    Member since:
    Jul 2012

    Posted 07 Aug 2012 Link to this post

    >> 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?"

  4. Rosen
    Admin
    Rosen avatar
    2641 posts
    Member since:
    Sep 2012

    Posted 07 Aug 2012 Link to this post

    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!

  5. David
    David avatar
    32 posts
    Member since:
    May 2012

    Posted 22 Aug 2012 Link to this post

    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.

  6. Dennis
    Dennis avatar
    30 posts
    Member since:
    Aug 2012

    Posted 23 Aug 2012 Link to this post

    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. 

  7. David
    David avatar
    32 posts
    Member since:
    May 2012

    Posted 23 Aug 2012 Link to this post

    I've had great support from Telerik. Hang in there.

  8. David
    David avatar
    26 posts
    Member since:
    Oct 2010

    Posted 24 Aug 2012 Link to this post

    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 }

  9. David
    David avatar
    32 posts
    Member since:
    May 2012

    Posted 24 Aug 2012 Link to this post

    Nothing. Somebody put in a ticket?

  10. Carlos
    Carlos avatar
    3 posts
    Member since:
    Aug 2012

    Posted 11 Sep 2012 Link to this post

    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}" }
                ],

  11. David
    David avatar
    32 posts
    Member since:
    May 2012

    Posted 11 Sep 2012 Link to this post

    I don't see how that's any different than what we've already been doing.

  12. Raymond
    Raymond avatar
    8 posts
    Member since:
    Jul 2012

    Posted 25 Sep 2013 Link to this post

    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.

Back to Top