I am trying to use Telerik MVC Q2 TabStrip which contains a Telerik MVC Grid within it. The Grid is returned in a Partial View by TabStrip's LoadContentFrom(). The Grid is based on ajax binding mode and works well in IE and Google Chrome. But when I use Mozilla Firefox, the Grid shows no records. Infact when I debugged the same, I found that the Controller Action method which fetches the records (as specified in databinding Ajax().Select() of the Grid) is never called. So this surely seems to be some JavaScript problem.
Looking for a solution on web, I came across various resources which basically hinted at including the Grid's JavaScript files manually in cases where the Grid is loaded inside a Partial View. Even though this is not required starting from the Telerik version 2011 Q2, nevertheless I tried registering the JavaScript files manually but could not get the grid working on Mozilla. Now I am really clueless as to what prevents the Telerik from fetching the d开发者_C百科ata using Ajax Binding. The TabStrip code is given below.
@(Html.Telerik().TabStrip().Name("TabStrip")
.Items(items =>
{
items.Add().Text("Donor List")
.LoadContentFrom("DonorList", "DonorSearch").Selected(true);
}))
The "DonorList" action method above returns a Partial View that contains the Telerik Grid in question. The Grid just displays itself with no records (and doesn't even call the Select() Action of ajax binding)
There is absolutely no issues with using the Telerik TabStrip inside a Grid. So beginning with Q2 2011, we don't have to register the Grid Scripts manually. They are included as required by the Telerik Scripts. My problem again turned out to be a very common error of including my custom javascript code in the Partial View. Once I moved it out of the Partial View, the grid worked fine.
regards, Nirvan.
精彩评论