jQWidgets Forums

jQuery UI Widgets Forums Getting Started jqxTagCloud demo code does not work as demo page shown

Tagged: 

This topic contains 2 replies, has 2 voices, and was last updated by  michaelwur 6 years, 7 months ago.

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author

  • michaelwur
    Participant

    Hi,
    I use the jqxTagCloud demo code but it shows as a UI list:

    displayed

    The following is the expected:

    expected

    I cannot figure out what’s wrong with the code!

    The code is shown below:

    
    <!DOCTYPE html>
    <%@page contentType="text/html" pageEncoding="UTF-8"%>
    <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
    <%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn" %>
    <html lang="en">
    <head>
        <title id='Description'>TagCloud basic demo</title>
        <link rel="stylesheet" href="<%=request.getContextPath()%>/jslibs/jqwidgets/styles/jqx.base.css" type="text/css" />
        <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
        <meta name="viewport" content="width=device-width, initial-scale=1 maximum-scale=1 minimum-scale=1" />	
        <script type="text/javascript" src="<%=request.getContextPath()%>/jslibs/jqwidgets/scripts/jquery-1.11.1.min.js"></script>
        <script type="text/javascript" src="<%=request.getContextPath()%>/jslibs/jqwidgets/jqwidgets/jqxcore.js"></script>
        <script type="text/javascript" src="<%=request.getContextPath()%>/jslibs/jqwidgets/jqwidgets/jqxdata.js"></script>
        <script type="text/javascript" src="<%=request.getContextPath()%>/jslibs/jqwidgets/jqwidgets/jqxtagcloud.js"></script>
        <script>
            // bind to itemClicked event.
            $('#jqxTagCloud').on('itemClicked', function (event) {
                var args = event.args;
                alert("You have clicked on: " + args.displayMember);
            });
            $(document).ready(function () {
                var data = [
                    { countryName: "Australia", technologyRating: 35 },
                    { countryName: "United States", technologyRating: 60 },
                    { countryName: "Germany", technologyRating: 55 },
                    { countryName: "Brasil", technologyRating: 20 },
                    { countryName: "United Kingdom", technologyRating: 50 },
                    { countryName: "Japan", technologyRating: 80 }
                ];
                var source =
                {
                    localdata: data,
                    datatype: "array",
                    datafields: [
                        { name: 'countryName' },
                        { name: 'technologyRating' }
                    ]
                };
                var dataAdapter = new $.jqx.dataAdapter(source, {});
                $('#jqxTagCloud').jqxTagCloud({
                    width: '600',
                    source: dataAdapter,
                    displayMember: 'countryName',
                    valueMember: 'technologyRating'
                });
            });
        </script>
    </head>
    <body class='default'>
    <div id="jqxTagCloud"></div>
    </body>
    </html>
    

    Best regards,
    Michael


    Martin
    Participant

    Hello Michael,

    This happens when the “base.css” file is not loaded.
    Please, check your styles reference.

    Best Regards,
    Martin

    jQWidgets Team
    http://www.jqwidgets.com/


    michaelwur
    Participant

    Hi Martin,
    You are right.

    This link in the post code:

    <link rel=”stylesheet” href=”<%=request.getContextPath()%>/jslibs/jqwidgets/styles/jqx.base.css” type=”text/css” />

    is incorrect. It should be

    <link rel=”stylesheet” href=”<%=request.getContextPath()%>/jslibs/jqwidgets/jqwidgets/styles/jqx.base.css” type=”text/css” />

    My fault.

    Thanks for your help!

    Best regards,
    Michael Wu

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

You must be logged in to reply to this topic.