3

jQuery Mobile Listview filterReveal Option

 5 months ago
source link: https://www.geeksforgeeks.org/jquery-mobile-listview-filterreveal-option/
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

jQuery Mobile Listview filterReveal Option

jQuery Mobile is a set of HTML5 based user interaction widget toolbox used for various purposes build on top of jQuery. It is designed to build fast and responsive websites accessible to mobile, tabs, and desktops. 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 will be using the jQuery Mobile Listview filterReveal option. The filterRevealoption is used to hide or show the search result list in the filter option of the Listview. Iftrue, the list hideswhen the search text is empty otherwiseit shows the full list of items. It also changes the data-filter-revealastrue for the unordered list.

Syntax: We need to pass either trueor falseas a parameter to filterReveal. Use the following syntax for initialization. 

$(".items").listview({
    filterReveal:true,
});
  • Get the filterReveal option:

    var filterRevealOption = 
        $(".items").listview( "option", "filterReveal" );
  • Set the filterReveal option:

    $(".items").listview( "option", "filterReveal", true );

CDN Links: Use the following CDNs of 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 are setting the option filterRevealto true.

<!DOCTYPE html>
<html lang="en">
<head>
<link rel="stylesheet" 
href=
<script src=
</script>
<script src=
</script>
</head>
<body>
<h1 style="color:green">
GeeksforGeeks
</h1>
<h3>jQuery Mobile Listview filterReveal Option</h3>
<ul class="items" data-filter-reveal="true">
<li>
<a href=
target="_blank">
Data Structures
</a
</li>
<li
<a href=
target="_blank">
Interview preparation
</a
</li>
<li
target="_blank">
Java Programming
</a
</li>
</ul>
<script>
$(".items").listview({
filter: true,
filterReveal: true,
});
</script>
</body>
</html>

Output:

jQuery Mobile Listview filterReveal Option

Reference: https://api.jquerymobile.com/listview/#option-filterReveal

Here's a complete roadmap for you to become a developer: Learn DSA -> Master Frontend/Backend/Full Stack -> Build Projects -> Keep Applying to Jobs

And why go anywhere else when our DSA to Development: Coding Guide helps you do this in a single program! Apply now to our DSA to Development Program and our counsellors will connect with you for further guidance & support.

Last Updated : 29 Dec, 2021
Like Article
Save Article
Share your thoughts in the comments

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK