Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7081183
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T06:53:17+00:00 2026-05-28T06:53:17+00:00

In jQueryMobile, I have written a data-role=listview component and I want to filter the

  • 0

In jQueryMobile, I have written a data-role="listview" component and I want to filter the data including its dividers. That is, when the user inputs some text to search, it may correspond to specific items or to dividers. In this last case, the whole divider and its subitems must be shown. The problem is that the default filtering mechanism ommits the dividers and I don’t know how to properly redefine the filterCallback function.

Does anyone know how to achieve this?

The code which I was trying is here.

Thanks in advance.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-28T06:53:17+00:00Added an answer on May 28, 2026 at 6:53 am

    Well I have something:

    • http://jsfiddle.net/DCkDp/24/

    JS

    $("#myList").listview('option', 'filterCallback', function (text, searchValue) { 
        $("li[data-groupoptions]").removeClass('override-ui-screen-hidden');
        $("li[data-groupoptions="+searchValue.toLowerCase()+"]").addClass('override-ui-screen-hidden');
        return text.toLowerCase().indexOf( searchValue ) === -1;
    });
    

    CSS

    .override-ui-screen-hidden {
        display:block !important;   
    }
    

    HTML

    <div data-role="page">
        <div data-role="content">
            <ul id="myList" data-role="listview" data-filter="true">
                <li data-role="list-divider" data-groupoptions="aaaa">AAAA</li>
                <li data-groupoptions="aaaa"><a href="index.html">Adam Kinkaid</a></li>
                <li data-groupoptions="aaaa"><a href="index.html">Alex Wickerham</a></li>
                <li data-groupoptions="aaaa"><a href="index.html">Avery Johnson</a></li>
                <li data-role="list-divider" data-groupoptions="bbbb">BBBB</li>
                <li data-groupoptions="bbbb"><a href="index.html">Bob Cabot</a></li>
                <li data-role="list-divider" data-groupoptions="cccc">CCCC</li>
                <li data-groupoptions="cccc"><a href="index.html">Caleb Booth</a></li>
                <li data-groupoptions="cccc"><a href="index.html">Christopher Adams</a></li>
                <li data-groupoptions="cccc"><a href="index.html">Culver James</a></li>
            </ul>
        </div>
    </div>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have the following jQueryMobile page anatomy at index.html: <div data-role=page> <div data-role=header>...</div> <div
I'm using jquerymobile. And on a list I have a filter. When a user
I have a page that is straight from the jQueryMobile site. I'm including a
jQueryMobile: In a simple listview I have the following: <li><a>SOME TEXT</a></li> A data-icon of
I have a jqueryMobile app that uses google maps api and is working properly
I have a jquery mobile list. This list is populated with data. I want
I have a simple listview in jQueryMobile which fills the width of the screen
I have created bottom fixed tabs using jquery mobile data-role=navbar inside a JQ footer.
I have an application that is using jquery, jquerymobile and spine.js running on phonegap
I have just started looking at JqueryMobile and want to know if the following

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.