I am using the grid with a details template.The data is remote and the data set is large. The method that populates the grid is only going to give me a subset of that data. Upon expansion, I want to query for the full data for each particular record. The schema stays the same. This is what I have so far in the detailInit function.
function detailInit(e) {
var detailRow = e.detailRow;
var defaultData = e.data;
$.ajax({
type: "GET",
url: urlBase + "candidatesearch/" + e.data.CandidateId,
contentType: 'application/json',
dataType: 'json',
success: function (data) {
kendo.bind(detailRow, data);
detailRow.find(".tabstrip").kendoTabStrip({
animation: {
open: { effects: "fadeIn" }
}
});
},
});
}
Everything seems to go fine. The event is fired, the data is retrieved but I cannot figure out a way to tell my template to refresh/rebind with the fully retrieved data. What am I missing?
Thank you in advance for your help.
8 Answers, 1 is accepted
Thank you for contacting us.
I examined the provided code and as far as I can see you are retrieving the value but you are not actually bind it to the grid. I would recommend you to examine the following live example which demonstrates how to create a hierarchical grid. Generally on detailInit event handler you are creating a new kendo grid which is populated with the detail data. I would suggest you to try this approach and let me know about the result.
I am looking forward to your reply.
Regards,
Kostadin
Telerik
In case you need to display the data in a tabular format then I would recommend you to use another kendo grid. Nevertheless, you can use any Kendo Widget or an html element to visualize the data.
Regards,
Kostadin
Telerik
Thanks for the reply. I don't think I'm being clear. My detail view is not tabular, it's not a grid and I don't want it to be a grid. If I did, I know how to make that work.
I understand that I can use any Kendo Widget to visualize details. That also works. The problem is that my details view needs to fetch a lot more data from the server to be meaningful. The call to my server to fetch succeeds and I call kendo.bind on the detail row with my newly fetched data (see code from my first post), but it's never rebinded. Perhaps this isn't supported or I'm going about it wrong. This is what I'm asking for guidance on.
Thank you again.
Hello William,
There is a detailInit event triggered once for every detail row when expanded for the first time. You can use this event to gather required data and build the UI for the detail template.
There is an online example which demonstrates how to buid the UI in that event.
Regards,
Nikolay Rusev
Telerik
As you can see from my initial post, I *AM* using the detailinit function and I've also stated that I do not want a grid within a grid. You're the second person to recommend the sample that I said I saw several times. Either I'm missing something very fundamental or you're not understanding my request. Either way, this is becoming very frustrating.
If a grid within a grid is the only way possible to rebind after loading data asynchronously, I will attempt to use that as a workaround.
My question is, why does the code in my very first post not rebind. Is this not supported or am I doing something wrong?
Hello William,
`As you can see from my initial post, I *AM* using the detailinit function and I've also stated that I do not want a grid within a grid. You're the second person to recommend the sample that I said I saw several times. Either I'm missing something very fundamental or you're not understanding my request. Either way, this is becoming very frustrating.` - Indeed the example is linked twice in this thread. It demonstrates the fundamentals of how to initialize any widget inside Grid detail template. It doesn't have to be another Grid. As you can see there is also a TabStrip and a plain HTML elements bound to the data from the item. I believe you should be able to implement this in your project as well.
`If a grid within a grid is the only way possible to rebind after loading data asynchronously, I will attempt to use that as a workaround.` - No, it is not the only option. It is a template so that the developer can place any content, see the previous above.
`My question is, why does the code in my very first post not rebind. Is this not supported or am I doing something wrong?` - I'm not sure why is not working in your project. I've prepared an example bellow which seems to operate correctly.
http://dojo.telerik.com/@rusev/eGeDE
Regards,
Nikolay Rusev
Telerik