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 8367999
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T13:17:19+00:00 2026-06-09T13:17:19+00:00

I am trying to attach events that would manipulate JQM components, but once I

  • 0

I am trying to attach events that would manipulate JQM components, but once I have a reference to the component, I do not know what actions I can apply to it. For example, with the new collapsible listview”, how would I collapse all the items with a button click? Here is the demo of the collapsible listview: http://jquerymobile.com/demos/1.2.0-alpha.1/docs/lists/lists-collapsible.html

  • 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-06-09T13:17:20+00:00Added an answer on June 9, 2026 at 1:17 pm

    For collapsible’s you can utilize the expand and collapse events:

    $('.ui-collapsible').trigger('expand');
    

    For example you can collapse/expand all the collapsible widgets in the DOM based on their current state like this:

    //attach the code to an event (click on a link)
    $('a').on('click', function () {
    
        //cache all the widgets
        var $all       = $('.ui-collapsible');
    
        //iterate through each widget
        $.each($all, function () {
    
            //if the widget has the "collapsed" class, then expand it
            if ($(this).hasClass('ui-collapsible-collapsed')) {
                $(this).trigger('expand');
            } else {
    
              //otherwise collapse it
              $(this).trigger('collapse');  
            }
        });
    });​
    

    Here is a demo: http://jsfiddle.net/HLEss/1/

    Here is an example collapsible widget’s HTML to verify that you can select by the “collapsed” class:

    <div data-role="collapsible" class="ui-collapsible ui-collapsible-collapsed">
        <h3 class="ui-collapsible-heading ui-collapsible-heading-collapsed">
            <a href="#" class="ui-collapsible-heading-toggle ui-btn ui-btn-up-c ui-fullsize ui-btn-icon-left ui-corner-top ui-corner-bottom ui-btn-active ui-btn-hover-null ui-btn-down-null" data-corners="false" data-shadow="false" data-iconshadow="true" data-wrapperels="span" data-icon="plus" data-iconpos="left" data-theme="null" data-mini="false">
                <span class="ui-btn-inner ui-corner-top ui-corner-bottom">
                    <span class="ui-btn-text">Zero
                        <span class="ui-collapsible-heading-status"> click to expand contents</span>
                    </span>
                    <span class="ui-icon ui-icon-plus ui-icon-shadow">&nbsp;</span>
                </span>
            </a>
        </h3>
        <div class="ui-collapsible-content ui-collapsible-content-collapsed" aria-hidden="true">
            <p>Woohoo!</p>
        </div>
    </div>
    

    I hope that helps.

    Update

    Here is the documentation for these events (sparse as it is): http://jquerymobile.com/demos/1.1.1/docs/content/content-collapsible-events.html

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a Gtk scrolled window that I'm trying to attach a PopupMenuHandler function
I am trying to attach the Netbeans profiler to my Java project but it
I'm trying to attach my database on a server that is running SQL2005 and
I am trying to attach a video in my mms application. But the application
I have a question related to this one : I'm trying to attach an
What I'm trying to do is create a class that I can quickly attach
I'm trying to find a simple way to attach click events to an element,
I am trying to use the code in this article that lets you know
I have been trying to attach a handler to the resize event in one
I am trying to attach 'click' events to all elements of a particular class.

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.