Git Product home page Git Product logo

Comments (6)

pjekel avatar pjekel commented on August 23, 2024

The cbtree does not check the store for updates, instead the store model listens for events from the store. All store related updates are event driven. To dynamically update the cbtree your store MUST emit change, new or remove events.

To have your custom store emit those kind of events you can use the Eventable store wrapper or you can implement your own event emission by including cbtree/Evented.js in your custom store.

You can take a look at the cbtree ObjectStore how the cbtree/Evented.js module is used.

Let me know if that works.

from cbtree.

adamskoog avatar adamskoog commented on August 23, 2024

I did actually try the Eventable wrapper before I posted that without any luck.

I did switch my store to mixing in your evented instead of the dojo one and am emitting the change event. this event is firing (I am catching it outside the tree as well to log it), but the readonly is not being updated still.

this.emit("change", { type: "change", detail: { item: object, oldItem: orgObj} });

Thanks for the quick reply!

from cbtree.

pjekel avatar pjekel commented on August 23, 2024

OK, considering you are using a customized store and I don't know which store you based it on (dojo/store or cbtree/store), please check the following:

  1. On order for the store model to recognize any store to be able to generate events, the store MUST
    have two properties:
    1. an emit() method
    2. eventable = true

As in:

emit: function (...) {
},

eventable: true,

Typically, the Eventable wrapper sets those properties for you.

Also make sure your have the enabledAttr property of the store model set to a valid store property. The default is an empty string.

from cbtree.

adamskoog avatar adamskoog commented on August 23, 2024

That was it, was missing the:

eventable: true

Thank you so much for your assistance, scrolled right down to the put method and skipped over that in the objectstore.

from cbtree.

adamskoog avatar adamskoog commented on August 23, 2024

Sorry to reopen this, but I have a related question. I got back to working on this this morning and noticed that the parent checkboxes are not being updated when children are clicked, and vice versa. In trouble shooting I removed the eventable: true from my store and now the checkboxes don't work but I'm back to the previous problem.

Just wondering if you have any ideas on what might cause this behavior? I was apparently so excited the readonly was working I didn't realize the vital bit wasn't functioning. Thanks for any help you can give!

from cbtree.

pjekel avatar pjekel commented on August 23, 2024

It is a little hard for me to 'remotely' diagnose the problem without having see any of your code. Please post a short question @ http://www.thejekels.com/blog/featured/the-new-dijit-checkbox-tree/ so I have your email and we can take this off line. For starters, list all version number of the products your are using such as dojo, cbtree. What kind of store model are you using? etc, etc.

from cbtree.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.