Wijmo UI for the Web
jQuery Mobile
Wijmo User Guide > Getting Started > jQuery Mobile

Adaptive Widgets

Adaptive widgets for use in jQuery Mobile applications are available in v3. If you are running v2.3.x, they are not included. You can download v3 here: Downloads Page. Widgets that are adaptive are marked with an asterisk * on the Widgets page.

Adaptive widgets are different from jQuery UI widgets in that you can use them in both mobile and non-mobile web applications. To use the adaptive widgets in non-mobile applications, use the regular help for each widget. To use them in mobile applications:

These steps are demonstrated in the Quick Start section below.

NOTE: If you run your mobile application on Android, all chart widgets require Android version Ice Cream Sandwich or higher in order to render, because they use SVG (Scalable Vector Graphics).

Quick Start

This quick start helps you to create a Web page for a mobile application, add an adaptive widget, and customize the appearance and behavior of the widget.

  1. To create a new HTML page in your favorite text editor, add the following code and save the document with an .html extension.

    Drop down and copy markup

    Paste in your favorite text editor.
    Copy Code
    <!DOCTYPE HTML>
    <HTML>
    <head>
    </head>
    <body>
    </body>
    </HTML>
    
  2. Add links to the dependencies to your HTML page within the <head> tags. Find the latest dependencies in the content delivery network (CDN) file at Mobile Wijmo CDN.

    Drop down and copy references to paste inside the head tags

    References
    Copy Code
    <!--jQuery References-->
    <script src="http://code.jquery.com/jquery-1.11.1.min.js" type="text/javascript"></script>
    <script src="http://code.jquery.com/mobile/1.4.0/jquery.mobile-1.4.0.min.js" type="text/javascript"></script>
      
    <!--Theme-->
    <link href="http://code.jquery.com/mobile/1.4.0/moonlight-mobile/jquery-wijmo.css" rel="stylesheet" type="text/css" />
      
    <!--Wijmo Widgets CSS-->
    <link href="http://cdn.wijmo.com/jquery.wijmo-pro.all.3.20183.140.min.css" rel="stylesheet" type="text/css" />
      
    <!--Wijmo Widgets JavaScript-->
    <script src="http://cdn.wijmo.com/jquery.wijmo-open.all.3.20183.140.min.js" type="text/javascript"></script>
    <script src="http://cdn.wijmo.com/jquery.wijmo-pro.all.3.20183.140.min.js" type="text/javascript"></script>
  3. Add the following markup within the <body> tags to create the widget. The first <div> element creates a jQuery mobile page, and the second one creates a jQuery Mobile content area. The third one creates the Wijmo Calendar widget, and its data-role attribute initializes it.

    Drop down and copy markup to paste inside the body tags

                
    Markup
    Copy Code
    <div data-role="page">
        <div data-role="content">
             <div data-role="wijcalendar"></div>
        </div>
    </div>
  4. Within the <head> tags, there is no need to add script to initialize the widget as this is done in markup using the data-role attribute.
  5. Save your HTML file and open it in a browser. The widget appears like the following.
See Also