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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T16:40:21+00:00 2026-06-06T16:40:21+00:00

The title may sound weird. Well, it is. Here’s an approximation of my code

  • 0

The title may sound weird. Well, it is.

Here’s an approximation of my code (it lacks some useless ajax calls for this example, and simplifies some other stuff): http://jsfiddle.net/pKNAz/3/

Suppose you have a list of draggable items (in this case, there’s only a draggable called “Add a Wysiwyg”) which you can move into a drop zone (a grey rectangle in my example), and it appends a textarea, which then, after dropping, I convert into a wysiwyg using the jwysiwyg library (i couldn’t add all the images and css this plugin uses, but the textarea basic behaviors (ctrl+b, ctrl+i, ctrl+u) work, so we can assume it’s working).

It works particularly well at drop time. However it turns to break the jwysiwyg when sorting. You can try it by yourself dragging the dark grey handle after having two jwysiwyg’s. You’ll see the jwysiwyg you sorted has lost its jwysiwyg. You can still get the correct value you previously wrote inside the textarea by searching $('textarea.overflow').val(), but you cannot use jwysiwyg anymore.

Has anybody an idea on how to solve this problem? 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-06-06T16:40:24+00:00Added an answer on June 6, 2026 at 4:40 pm

    Ok, I got a solution (sorry Jan for removing your tick).
    I wondered that, if the problem was due to the combination between the iframe zone and the sort events, the why not just refresh the wysiwygs?

    I create a function to wrap the destruction+construction of jwysiwyg, like this:

    function refreshTextareas()
    {
        $('textarea.autogrow').wysiwyg('destroy');
        $("textarea.autogrow").wysiwyg({
            autoGrow: true,
            rmUnusedControls: true,
            controls: {
                bold: { visible : true },
                italic: { visible : true },
                insertOrderedList: { visible : true },
                insertUnorderedList: { visible : true },
                removeFormat: { visible : true },
                h1: { visible: true },
                link : { visible: true }
            }
        });
    }
    

    and then I call it here:

    $( "#sortable" ).sortable({
        stop : function(event, ui){
            refreshTextareas();
        }
    });
    

    So, in case you sort the stuff, you reconstruct it and it works again, just like that.

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

Sidebar

Related Questions

Title may be confusing, but here's explanation with code. Based on some conditions, I
That title may need some work. Perhaps after reading this, you may be able
Ok, the title may sound a little weird, but I think that kinda describe
The title may sound confusing. But here's my issue. I want to show something
ok not as simple as title may make it sound. I tried this in
As weird as it may sound, the code that generated pdf using Prawn gem
The title may sound odd, but im kind of trying to set up this
This title may sound a little bit crazy, but this is what is making
I know the title may sound a little weird, but the same goes for
The title may sound confusing but it actually isn't, I just didn't know how

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.