Button in KendoGrid

4 posts, 0 answers
  1. Tyler
    Tyler avatar
    6 posts
    Member since:
    Jan 2012

    Posted 09 Jan 2012 Link to this post



    Hi everyone! I'm testing this new API and i really like it, but I'm trying to put a personal button in a kendoGrid field, but i don't really know how to made this.

    I look in the documentation, and anything in it help me to solve my problem.

    I've tried to put some HTML in it, but i didn't find an associated type for HTML insertion.

    So how can i instantiate a button in my kendoGrid.

    Thank you !
     
  2. Tyler
    Tyler avatar
    6 posts
    Member since:
    Jan 2012

    Posted 10 Jan 2012 Link to this post

    My question is it too stupid to deserve an answer?
  3. John Thompson
    John Thompson avatar
    44 posts
    Member since:
    Dec 2009

    Posted 20 Jan 2012 Link to this post

    Have you tried using row templates?  I have a billing related application and I use links and buttons within the kendoGrid.

    <script id="rowTemplate" type="text/x-kendo-template">
        <tr>
            <td style="text-align: center">
                <a class="invoiceNumber" href="\#">${InvoiceNumber}</a>
            </td>
    ...

    You can then use jQuery in the dataBound event to attach a delegate to the click event.

    dataBound: function ()
    {
        this.expandRow(this.tbody.find("tr.k-master-row").first());
     
        $("#worklistGrid").delegate(".invoiceNumber", "click", setStatus);
    }



  4. Amol
    Amol avatar
    5 posts
    Member since:
    Jan 2012

    Posted 24 Jan 2012 Link to this post

    Hope this helps

    { field: "ItemName",
       template: "<div><table><tr><td width='150px'>${ ItemName }</td><td><input id='btnOpenDialog'      type='button' style='background-image:url(glass.png)'onclick='javascript:onclick(\"#=ItemCode#\");' /></td></tr></table><div>", width: "200px" },

    This will show an button with image and when clicked will run 'onclick'  javascript function
Back to Top