jQWidgets Forums
jQuery UI Widgets › Forums › Getting Started › jqxTagCloud demo code does not work as demo page shown
Tagged: jqxTagCloud
This topic contains 2 replies, has 2 voices, and was last updated by michaelwur 6 years, 7 months ago.
-
Author
-
Hi,
I use the jqxTagCloud demo code but it shows as a UI list:The following is the 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,
MichaelHello Michael,
This happens when the “base.css” file is not loaded.
Please, check your styles reference.Best Regards,
MartinjQWidgets Team
http://www.jqwidgets.com/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 -
AuthorPosts
You must be logged in to reply to this topic.