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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T00:39:42+00:00 2026-05-14T00:39:42+00:00

I have main categories and sub categories. I want to be able to sort

  • 0

I have main categories and sub categories.
I want to be able to sort subcategories when the display is like:

Main Cat1  
  sub cat11            [handle]
  sub cat12            [<>]
  sub cat13            [<>]
Main Cat2
  sub cat21            [<>]
  sub cat22            [<>]
  sub cat23            [<>]

This turned in HTML

<ul id="order-list-1" class="c_order_list"> 
                    <li id="listItem-2" style=" margin-top:10px;">Sculpture<div style="float:right" align="right"><img src="images/add.png" style="vertical-align:middle; margin-bottom:2px;" onclick="showSubcategoryAddBox(2)"></div></li> 
                                        <li id="subcat-4" style="padding-left: 25px; width: 555px;">subcat1 Of maincat2<div style="float: right;" align="right"><img src="images/handle.png" alt="move" width="18" height="18" class="handle" /></div></li> 
                                        <li id="subcat-5" style="padding-left: 25px; width: 555px;">subcat2 Of maincat2<div style="float: right;" align="right"><img src="images/handle.png" alt="move" width="18" height="18" class="handle" /></div></li> 
</ul> 
<ul id="order-list-2" class="c_order_list"> 
                    <li id="listItem-1" style=" margin-top:10px;">Mantel Clocks<div style="float:right" align="right"><img src="images/add.png" style="vertical-align:middle; margin-bottom:2px;" onclick="showSubcategoryAddBox(1)"></div></li> 
                                        <li id="subcat-1" style="padding-left: 25px; width: 555px;">subcat1 Mantel Clocks<div style="float: right;" align="right"><img src="images/handle.png" alt="move" width="18" height="18" class="handle" /></div></li> 
                                        <li id="subcat-2" style="padding-left: 25px; width: 555px;">subcat2 Mantel Clocks<div style="float: right;" align="right"><img src="images/handle.png" alt="move" width="18" height="18" class="handle" /></div></li> 
                                        <li id="subcat-3" style="padding-left: 25px; width: 555px;">subcat3 Mantel Clocks<div style="float: right;" align="right"><img src="images/handle.png" alt="move" width="18" height="18" class="handle" /></div></li> 
</ul> 

I could do with one section only eg: sorting main cats

$(document).ready(function() {
    var order = null;
    $("#order-list").load(location.href+" #order-list>*","");   
    $("#order-list").sortable({
      handle : '.handle',
      update : function (e, ui) {
             order = $(this).sortable('serialize');
         $("#info").load("process-sortable.php?"+order);
    }
    });

But can’t figure out how would I be able to sort the subcategories in their section?

  • 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-14T00:39:42+00:00Added an answer on May 14, 2026 at 12:39 am

    There is a spot in your HTML that you need to fix, your subcategories need their own

      tags. Your HTML should follow something similar to:

      <ul id="main-cats">
       <li><span class="main-cat-handle">Main Cat 1</span>
        <ul id="main-cat-1">
         <li id="sub-cat-1"><span class="sub-cat-handle">Sub Cat 1</span></li>
         <li id="sub-cat-2"><span class="sub-cat-handle">Sub Cat 2</span></li>
         <li id="sub-cat-3"><span class="sub-cat-handle">Sub Cat 3</span></li>
        </ul&gt
       </li>
      </ul>

      Now you should be able to call sortable on #main-cats and #main-cat-X using the specified handles, this should allow you to sort the way you desire.

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

    Sidebar

    Related Questions

    I built a classified. In the main/index.php page, I have many categories like cars,
    I have a main category and some sub-categories for this category and I wanted
    I have a vertical menu with sub categories. When a main category is clicked
    i have a main table categories like this categories_id | categories_status | parent_id 1
    I have main.cpp (including main function) and func1.cpp, and I want to link these
    I have a form that looks like: <form action=search.php method=post> <fieldset> <label for=level_one>Main category</label>
    I have one usercontrol where am showing the main categories as buttons from the
    I have a view that make a query to get the main menu: categories
    I'm developing a site using Wordpress which uses Categories for main sections with sub
    I have list of categories , some have sub-category and some have sub-sub-category which

    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.