Skip to content
Related Articles

Related Articles

jQuery Mobile Listview disabled Option

View Discussion
Improve Article
Save Article
Like Article
  • Last Updated : 23 Dec, 2021

jQuery Mobile is an HTML5 based user interface system designed to make responsive websites and apps that are accessible on all smartphone, tablet, and desktop devices. jQuery Listview is a widget used to create beautiful lists. It is a simple and responsive listview used to view the unordered lists.

In this article, we are going to learn the disable option of the Listview of the jQuery Mobile. This option turns off all the functions of the Listview such as filtering, etc, if its value is set to true. We cannot perform searching for the Listview items. It is of boolean type & its default value is false.

Syntax: The syntax for the disabled option of the Listview is as follows:

$(".items").listview({
    disabled: true,
});

 

CDN Links: Use the following CDN links for the jQuery Mobile for your project.

<link rel=”stylesheet” href=”https://code.jquery.com/mobile/1.4.5/jquery.mobile-1.4.5.min.css” />
<script src=”https://code.jquery.com/jquery-1.11.1.min.js”></script>
<script src=”https://code.jquery.com/mobile/1.4.5/jquery.mobile-1.4.5.min.js”></script>

Example: In the following example, we have disabled the filter option of the listview even it is turned to true.

HTML




<!DOCTYPE html>
<html lang="en">
  
<head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" 
          content="IE=edge" />
    <meta name="viewport" 
          content="width=device-width, 
                   initial-scale=1.0" />
    <link rel="stylesheet" 
          href=
    <script src=
    </script>
    <script src=
    </script>
</head>
  
<body>
    <h1>GeeksforGeeks</h1>
    <h3>jQuery Mobile Listview disabled option</h3>
    <ul class="items" 
        data-role="listview" 
        data-disabled="true">
        <li
            <a href=
               target="_blank">Data Structures
            </a
        </li>
        <li
            <a href=
               target="_blank">Interview preparation
            </a
        </li>
        <li>
            <a href=
               target="_blank">Java Programming
            </a
        </li>
    </ul>
    <script>
    $(".items").listview({
        filter: true,
        disabled: true,
    });
    </script>
</body>
  
</html>

Output

Reference: The official docs of the disabled option of Listview are as follows:

https://api.jquerymobile.com/listview/#option-disabled


My Personal Notes arrow_drop_up
Recommended Articles
Page :

Start Your Coding Journey Now!