displaying grid multiple times inside the panelbar

4 posts, 0 answers
  1. charan
    charan avatar
    29 posts
    Member since:
    May 2012

    Posted 01 Jul 2012 Link to this post

    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.
  2. Kamen Bundev
    Admin
    Kamen Bundev avatar
    1532 posts

    Posted 04 Jul 2012 Link to this post

    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!
  3. Kendo UI is VS 2017 Ready
  4. wizmagister
    wizmagister avatar
    37 posts
    Member since:
    Nov 2011

    Posted 05 Jul 2012 Link to this post

    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 !

  5. charan
    charan avatar
    29 posts
    Member since:
    May 2012

    Posted 19 Jul 2012 Link to this post

    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.
Back to Top
Kendo UI is VS 2017 Ready