How to reinitialize detailInit

1 Answer 52 Views
Grid
Davis
Top achievements
Rank 1
Davis asked on 25 Sep 2023, 06:28 AM | edited on 25 Sep 2023, 08:57 AM

detailInit event firing  only first time but need to required always ,How to handle 

if i use detailExpand event not finding e.detailCell and e.data.id 

i am using code like this

 <script type="text/x-kendo-template" id="detail-template">

                             <div class="texarea_group no-gutters row">
                              <div class="col-4">
                                  <h3>Complaint</h3>

                                  <textarea id="txtClmComplaintNCL_#= id#"></textarea>
                              </div>

 </div>                
                          </script>

1 Answer, 1 is accepted

Sort by
0
Zornitsa
Telerik team
answered on 27 Sep 2023, 02:56 PM

Hello Davis,

Indeed, the suitable approach for achieving the desired behavior is using the detailExpand event, which fires every time a detail row is expanded. You are also correct that e.detailCell and e.data cannot be accessed directly there, as in the detailInit event, however, you could obtain them with the following selectors:  

detailExpand: function(e) {
    //detailcell
    $(e.detailRow).find(".k-table-td.k-detail-cell");

    //data
    e.sender.dataItem(e.masterRow);
}

Linked below is a small Dojo example that I prepared for a better understanding. In this Dojo, you can observe in the DevTools(F12) console of the browser that the exact same objects are accessed in both events by using the mentioned selectors: 

Let me know if the suggested approach is what you are looking for.

Regards,
Zornitsa
Progress Telerik

Stay tuned by visiting our public roadmap and feedback portal pages! Or perhaps, if you are new to our Kendo family, check out our getting started resources
Tags
Grid
Asked by
Davis
Top achievements
Rank 1
Answers by
Zornitsa
Telerik team
Share this question
or