Premium forums

Kendo UI Grid custom command bug

  • S
    S avatar

    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.
  • Rosen
    Rosen avatar

    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!
  • Matt
    Matt avatar

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

  • Rosen
    Rosen avatar

    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!
  • David
    David avatar

    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.
  • Dennis
    Dennis avatar

    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. 
  • David
    David avatar

    23 Aug 2012 (Link to this post)

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

    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 }
  • David
    David avatar

    24 Aug 2012 (Link to this post)

    Nothing. Somebody put in a ticket?
  • Carlos
    Carlos avatar

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

  • David
    David avatar

    11 Sep 2012 (Link to this post)

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

Read FAQ or see Kendo UI in action!

Launch Demos