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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T16:37:48+00:00 2026-06-16T16:37:48+00:00

See the jsFiddle link here for the UI I am trying to construct. First,

  • 0

See the jsFiddle link here for the UI I am trying to construct. First, the user selects a Conference. The Events for the selected Conference are shown in the Accordion, and each Event has Tables which are shown inside the Accordion as a plain html table. The user should be able to drag/drop the Tables and customize their Sort Order. All this is backed by Knockout JS which has worked great so far, but I’ve hit a block…

The first problem I had was “data-binding” the Accordion. I implemented the custom binding handler solution found here, and this seems to work great. However, I can’t seem to reliably wire up the sortable functionality for the Table records.

I can’t simply call $(".sortable tbody").sortable(); in the $(document).ready(function(){});. Although that works the for the first Conference, as soon as the SelectedConference changes, the sortable functionality is lost. I could add it to the update function of the Accordion’s custom binder:

update: function (element, valueAccessor) {

            var options = valueAccessor();
            $(element).accordion("destroy")
            $(element).accordion({ active: "h3:last", collapsible: true });

            //TODO: add sortable call here
        }

That seems to work, but I’m new to custom binders. Is this innefficient? Are there better ways to implement the sortable functionality?

Thanks!

  • 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-16T16:37:49+00:00Added an answer on June 16, 2026 at 4:37 pm

    Don’t worry about custom binding handlers they are the right place to put this kind of logic.

    However I would suggest that you should create a new custom binding only for the sortable logic because it has nothing to do with your accordions:

    ko.bindingHandlers.sortable = {
        init: function (element, valueAccessor) {
            var options = valueAccessor() || {};
            $(element).sortable(options);
        }
    }
    

    Then you can use it your html:

    <tbody data-bind="foreach: Tables, sortable: {}">
    

    Demo JSFiddle.

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

Sidebar

Related Questions

See here: http://jsfiddle.net/zYcJm/ The jQuery should be validating each field to check if they
If you see this JSFiddle here , I'm simply trying to animate in a
http://jsfiddle.net/FS4zT/ If you visit the above link you see what am describing below. Summary:
As you can see in this jsfiddle , I'm trying to make a toggle
I have a drop down menu which you can see here on jsfiddle .
I have two select boxes with dates. See here the jsfiddle: http://jsfiddle.net/egrba/ The people
Here is a fiddle: http://jsfiddle.net/sAuhsoj/zSGLy/3/ I am trying to vertically centre the images in
I have recreated my menu here: http://jsfiddle.net/bVQ2H/2/ As you can see, it has a
What I'm trying to do is have the user click a table which selects
You can see the jsfiddle link for my code How to put the style

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.