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

displaying grid multiple times inside the panelbar

3 Answers 110 Views
PanelBar
This is a migrated thread and some comments may be shown as answers.
charan
Top achievements
Rank 1
charan asked on 01 Jul 2012, 12:53 PM
hi,
I have a panel bar and grid.I want to display grid inside the panel bar.I loaded the panel bar using ajax.I created the grid in a separate view.I have loaded the grid inside the panel bar using "contentUrl".it is displaying in side the panel bar but the grid is displaying two times as shown in the following attachment. can u tell me what is the reason for displaying the grid multiple times.

3 Answers, 1 is accepted

Sort by
0
Kamen Bundev
Telerik team
answered on 04 Jul 2012, 12:29 PM
Hi Charan,

Note that every content loaded with Ajax is evaluated and any scripts in it executed. This means that if your Grid init scripts are in the partial content you load, it may get initialized by itself. Can you post a sample of your issue, so that we can take a look at it?

All the best,
Kamen Bundev
the Telerik team
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
0
wizmagister
Top achievements
Rank 2
answered on 05 Jul 2012, 06:12 PM
Hello, I had exactly the same issue. Make sure NOT to include your grid's initialisation inside the <li> of the panel. 

In fact, I recommend not having any javascript inside the <li> at all. 

Hope this helps !

0
charan
Top achievements
Rank 1
answered on 19 Jul 2012, 06:45 AM
I have the grid in separate view page of name Grid.cshtml.
and I am loading the grid inside the panelbar like
                 $.ajax({                       
                type: "POST",
                url: '/Contacts/GetPanelInfo',
                contentType: "application/json; charset=utf-8",
                dataType: "json",
                success: function (json) {

                    $("#panelBar").kendoPanelBar({
                        expandMode: "single",
                        id: "groups_usr_id",
                        dataSource: [{ text: json[0].groups_name, expand: true, contentUrl: "/Home/Grid" },
                                         { text: json[1].groups_name, expand: true },
                                         { text: json[2].groups_name, expand: true}]
                    });

                }

            });
If i give like this the grid is loading inside the panel bar but some times it is loading multiple times.
    and one more thing i want to know,To load the panel bar i used like json[0].groups_name,json[1].groups_name but i don't think this is the right way to load the panel bar dynamically.so Is there any other way to load the panel bar dynamically.
Tags
PanelBar
Asked by
charan
Top achievements
Rank 1
Answers by
Kamen Bundev
Telerik team
wizmagister
Top achievements
Rank 2
charan
Top achievements
Rank 1
Share this question
or