jQWidgets Forums

This topic contains 1 reply, has 2 voices, and was last updated by  Peter Stoev 11 years, 3 months ago.

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Menu Loading Posts
  • Menu Loading #50502

    DeviNagaraj
    Participant

    Hi,

    I am using jqxmenu in my masterpage.While executing the application menu binding takes some long time to load.

    My aspx pages getting loaded before this menu loading.

    This is my master page content,

    <%@ Master Language="C#" AutoEventWireup="true" CodeFile="MasterPage.master.cs" Inherits="MasterPage" %>
    
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head runat="server">
        <title></title>
        <link rel="stylesheet" href="jqwidgets/styles/jqx.base.css" type="text/css" />
        <script type="text/javascript" src="Scripts/jquery-1.10.2.min.js"></script>
        <script type="text/javascript" src="jqwidgets/jqxcore.js"></script>
        <script type="text/javascript" src="jqwidgets/jqxinput.js"></script>
        <script type="text/javascript" src="jqwidgets/jqxdata.js"></script>
        <script type="text/javascript" src="jqwidgets/jqxmenu.js"></script>
        <script type="text/javascript" src="jqwidgets/jqxbuttons.js"></script>
        <script type="text/javascript" src="jqwidgets/jqxscrollbar.js"></script>
        <script type="text/javascript" src="jqwidgets/jqxlistbox.js"></script>
        <script type="text/javascript" src="jqwidgets/jqxcombobox.js"></script>
        <script type="text/javascript" src="Scripts/knockout-2.2.1.js"></script>
        <asp:ContentPlaceHolder ID="head" runat="server">
        </asp:ContentPlaceHolder>
        <script type="text/javascript">
            $(document).ready(function () {
                LoadMenu();
            });
    
            function LoadMenu() {
                var data = [
                    {
                        "id": "2",
                        "text": "<a href='MyMenu.aspx'><img style='float: left; margin-right: 5px;' src='/images/icons_news.jpg' />Frappuccino</a>",
                        "parentid": "1",
                        "subMenuWidth": '250px',
                        "favText": "Charge Point Status"
                    },
                    {
                        "text": "Chocolate Beverage",
                        "id": "1",
                        "parentid": "-1",
                        "subMenuWidth": '250px',
                        "favText": "Device Status"
                    }, {
                        "id": "12",
                        "parentid": "1",
                        "text": "Hot Chocolate",
                        "favText": "User Details"
                    }, {
                        "id": "3",
                        "parentid": "1",
                        "text": "Peppermint Hot Chocolate",
                        "favText": "Pages"
                    }, {
                        "id": "4",
                        "parentid": "1",
                        "text": "Salted Caramel Hot Chocolate",
                        "favText": "Manage Users"
                    }, {
                        "id": "5",
                        "parentid": "1",
                        "text": "White Hot Chocolate",
                        "favText": "Agreements"
                    }, {
                        "id": "6",
                        "text": "Espresso Beverage",
                        "parentid": "-1",
                        "subMenuWidth": '200px',
                        "favText": "Charge Point Status"
                    }, {
                        "id": "7",
                        "parentid": "6",
                        "text": "Caffe Americano",
                        "favText": "Charge Point Status"
                    }, {
                        "id": "8",
                        "text": "Caffe Latte",
                        "parentid": "6",
                        "favText": "Charge Point Status"
                    }, {
                        "id": "9",
                        "text": "Caffe Mocha",
                        "parentid": "6",
                        "favText": "Charge Point Status"
                    }, {
                        "id": "10",
                        "text": "Cappuccino",
                        "parentid": "6",
                        "favText": "Charge Point Status"
                    }, {
                        "id": "11",
                        "text": "Pumpkin Spice Latte",
                        "parentid": "6",
                        "favText": "Charge Point Status"
                    }, {
                        "id": "15",
                        "text": "450 calories",
                        "parentid": "13",
                        "ur": "Menu.htm",
                        "favText": "Charge Point Status"
                    }, {
                        "id": "16",
                        "text": "16g fat",
                        "parentid": "13",
                        "favText": "Charge Point Status"
                    }, {
                        "id": "17",
                        "text": "13g protein",
                        "parentid": "13",
                        "favText": "Charge Point Status"
                    }]
    
                // prepare the data
                var source =
                    {
                        datatype: "json",
                        datafields: [
                            { name: 'id' },
                            { name: 'parentid' },
                            { name: 'text' },
                            { name: 'ur' },
                            { name: 'subMenuWidth' },
                            { name: 'href' }
                        ],
                        id: 'id',
                        localdata: data,
                        async: true
                    };
    
                // create data adapter.
                var dataAdapter = new $.jqx.dataAdapter(source);
                // perform Data Binding.
                dataAdapter.dataBind();
                var records = dataAdapter.getRecordsHierarchy('id', 'parentid', 'items', [{ name: 'text', map: 'label'}]);
                $('#jqxWidget').jqxMenu({ source: records, width: '100%' });
            }
    
        </script>
    </head>
    <body>
        <form id="form1" runat="server">
        <div>
        Master page
        <div id='jqxWidget' style="float: left">
                </div>
            <asp:ContentPlaceHolder ID="ContentPlaceHolder1" runat="server">
                
            </asp:ContentPlaceHolder>
        </div>
        </form>
    </body>
    </html>

    Please give me some way to speed up the menu loading.

    Menu Loading #50505

    Peter Stoev
    Keymaster

    Hi DeviNagaraj,

    We do not see a problem with the Menu’s loading. I do not know why it takes long time on your side, but I do not think that the problem is in the Menu.

    Best Regards,
    Peter Stoev

    jQWidgets Team
    http://www.jqwidgets.com

Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.