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

  • Home
  • SEARCH
  • 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 8837345
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T09:42:01+00:00 2026-06-14T09:42:01+00:00

This question is related with one I asked before here . I’m currently using

  • 0

This question is related with one I asked before here. I’m currently using KineticJS 4.0.5 and I’m using multiple layers to display some shapes with different properties. Since I need to change the layers contents frequently I’m using removeChildren to remove a layer content, but it seems that removeChildren also removes the events associated to childrens. I would like to remove the layer childrens without removing their events because I may have to add them to the layer again.

I tried to set the layer.childrens attribute equal to an empty Array instead of using the removeChildren function. At first it seemed to work but on some cases, some weird things happen :/ Some shapes disappear and the only way to get them back is by setting their Z index. I think the main problem with this approach is related with some properties that must be reseted when contents are removed from the layer, but I don’t know which are they.

I also tried to set the events again on each shape before drawing them but it doesn’t work… They remain static on the screen… I event tried to use the setDraggable(true) on all shapes before drawing them but no luck… Do I need to create the objects again and apply the events to them again each time I want to redraw a layer with shapes I used before? Or would it be a good approach to store layers for each screen on my application? (I can have a lot of different screens, which would result in a lot of layers and only one would be displayed at a time…)

If you know a solution for this problem please tell me. I really need to solve this problem because it is very important for my project to be able to draw and redraw :/

Thank you!

  • 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-14T09:42:02+00:00Added an answer on June 14, 2026 at 9:42 am

    Sounds to me that what you need is a way to visually remove objects from layers, but not actually delete them. Instead of using remove, try creating a new layer specifically for storage, where your main group within that layer is hidden. You’ll want this group, and its layer, to be globals for easy access. Then, when you need to remove an object from view, use moveTo to move it into storage, and moveTo again to restore it to view.

    var gObj = {storage : '', storageGroup : ''};
    gObj.storage = new Kinetic.Layer();
    gObj.storageGroup = new Kinetic.Group({name:'storage', x:0, y:0});
    gObj.storage.add(gObj.storageGroup);
    // assumes stage is already built
    stage.add(gObj.storage);
    gObj.storageGroup.hide();
    function wareHouse(obj, group, store) {
        // obj is an object to store when store === true, otherwise it's a name or id when retreiving, group is the group where object either is or needs to be, store is a boolean value
        if (store) {
            obj.moveTo(gObj.storageGroup);
        } else {
            // change the dot to pound ('.' = '#') if using id's
            var box = gObj.storageGroup.get('.' + obj)[0];
            box.moveTo(group);
        }
        var parent = group.getLayer();
        parent.draw();
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

This question is related to the one I asked here . I'm trying to
This question is related somewhat to the one i asked HERE . Now, i
This question is related to one I asked previously, see here . As a
This question is similar to the one i asked here . But its related
I've asked a question related to this one here: Securely Passing UserID from ASP.Net
This question is related to one I asked the other day which I got
This question is maybe related to the question i asked here: Jquery ajax request
I asked a question related to this one previously but I need to know
This is a question related to another one I asked that was specific to
This question is related to my earlier question, asked here: How do I get

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.