This is a migrated thread and some comments may be shown as answers.
Ajax MasterDetail View
3 Answers 40 Views
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Ajay
Top achievements
Rank 1
Ajay asked on 22 Aug 2011, 10:03 AM
Hi
I have a standard ASPX page having some tab controls.
Each tab control loads on demand a partial view say PV1.
This PV1 has a grid with Ajax binding with detail view.
The details view comes from another partial view & controller.

Everything works fine. (Almost). (There are no javascripts in any of my pages). All rows are collapsed in the beginning.
When I click on the expand button, it works flawlesslessly.

However there is a BIG catch here.
If I click Row 1 expand button, it works but thereafter, it does not work for subsequent rows in the grid page. 
HOWEVER, if I expand Row n, then Row n-1 expands as expected.
e.g If I expand row 5, row 4 works ok, then 3, then 2 and then 1
but if I expand row 5 then row 2, then int this case, only row 1 expands but not rows 3 and 4.
It there were any js errors, it should have not worked at all

Debugging revealed that Ajax request is fired only for those rows that work. Ajax event is not fired otherwise.
So, per say, there is nothing wrong in controller side.
Chrome Javascript debugger does not show any anamoly either?
Same behaviour on three browsers (IE,FF&Cr).

Is there any additional java scripts I need to register in the site master.
I am using Q2-2011 version of MVC opensource controls.


Ajay

3 Answers, 1 is accepted

Sort by
0
Ajay
Top achievements
Rank 1
answered on 22 Aug 2011, 11:42 AM
Hi
I guess I understand the problem but do not know how to resolve
Since all of the detail view sub-grids  has the same name and use a separate partial controller,
the controller is unable to identify which grid to update.
Why it works is one direction and not in the reverse is not clear.
Ajay
0
elaine
Top achievements
Rank 1
answered on 08 Nov 2011, 10:15 AM
Hi Ajay,

I'm having the same issue.

I think the selector always gets the first one. So row(n-1) wins row(n).

Have you found a solution for this?

thanks,
Elaine
0
Ajay
Top achievements
Rank 1
answered on 19 Nov 2011, 11:30 AM
Solution:
Name each of the child elements based on the master item
e.g
 .DetailView(
             detailView => detailView.ClientTemplate (
                  Html.Telerik().TabStrip()
                        .Name("TabStrip_DemandScan_<#= CustomerID #>")
                        .SelectedIndex(0)
                       .Items(items =>
                       {

etc
works like charm

Yes, the reverse is not clear..
Ajay
Tags
Grid
Asked by
Ajay
Top achievements
Rank 1
Answers by
Ajay
Top achievements
Rank 1
elaine
Top achievements
Rank 1
Share this question
or