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

Adding button into child grid of Hierarchy Grid

1 Answer 284 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Venkat
Top achievements
Rank 1
Venkat asked on 22 Aug 2013, 09:13 AM
Hello,

I'm using KENDO UI Web controls in HTML5/MVVM framework. And i'm using Hierarchy grid with with multiple tabs in the detail section. I have used 'detailsTemplate' to show Texbox and button in one of the tabs in the detail section of the hierarchy grid.
<script type="text/x-kendo-template" id="template">
            <div class="tabstrip" style="height:100%">
                 <ul>
                    <li class="k-state-active">Tab1</li>
                    <li>Tab2</li>
                    <li>Tab3</li>
                </ul>
                <div class="tab1">                </div>
                <div>
                    <div class="tab2" style="height:130%;overflow:auto" ></div>
                </div>
                <div class="tab3">
                <table>
                <tr>
                <td>
                <textarea id="txtUserText" rows="5" cols="20" style="width:99%" tabindex="3" data-bind="value:userTxt"></textarea>    
                </td>
                </tr>
                 <tr>
                 <td>
                 <button class="k-button" id="btnAddText" data-bind="click: addText_click"  style="float:right"> <span class="k-icon k-i-save"></span><span>Add Note</span> </button>
                 </td>
                </tr>
                </table>
                </div>
            </div>   
           </script>
The issue i'm facing is that click event on the button is not firing?

Could you please let me know what i'm missing?

Thanks

1 Answer, 1 is accepted

Sort by
0
Petur Subev
Telerik team
answered on 26 Aug 2013, 06:24 AM
Hello Venkat,

The detailTemplate is not bound to the model of the Grid, however you can do it manually when the detailInit event of the Grid occurs.
e.g.

function onDetailInit(e){
     kendo.bind(e.detailRow,e.data)
}

Another way would be to attach the click handler manually when the detailInit event is triggered.

function onDetailInit(e){
    $('.someClassOfTheButton').click(function(){
          alert('the button was clicked');
    })
}


Kind Regards,
Petur Subev
Telerik
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
Tags
Grid
Asked by
Venkat
Top achievements
Rank 1
Answers by
Petur Subev
Telerik team
Share this question
or