Creating a parent-level collection from a data interactive

CODAP Forums CODAP Help Forum Creating a parent-level collection from a data interactive

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #393 Score: 0
    Anna Fergusson
    Participant

    Hello again

    I am working on a few different data interactives. The issue I keep running into is that I can not create a new parent-level collection by dragging and dropping a column from the table created. If I export the table created and import it back into CODAP, I can create a new parent-level collection.

    I thought it might be the setting I am (or am not) using when creating the new collection in my data interactive, so I read the documentation for developing data interactives on github. This led me to try preventDataContextReorg: false with no success.

    Help 🙂

    Anna

    #394
    Bill Finzer
    Keymaster

    Hello Anna,

    There are at least two things going on here:

    1. As you correctly suspected, the flag preventDataContextReorg (I’m pretty sure) defaults to true. It defaults to true so that your users won’t reorganize their data and make it impossible for your data interactive (plugin) to add more data. But you can set it to false as shown in the section Example: InteractiveFrameUpdate of the API documentation. It sounds like you tried this with no success, but try again and if still no luck, ask here.
    2. If you want to be able to add data no matter how users may have reorganized things, use the Items api instead of the Cases api.

    Can you share a bit more about your situation and the plugins you are creating?

    Bill

    #395
    Anna Fergusson
    Participant

    Hello Bill

    Thanks for this. I realised my mistake – I was trying to use the preventDataContextReorg flag with the wrong resource – whoops!

    [I skim read the documentation, and for some reason linked the DataContext part of the flag with creating an actual DataContext]

    Everything now is working perfectly 🙂

     

    Thank you so much for being so responsive and helpful.

    Anna

    #744
    Tim Erickson
    Participant

    Let me underline a current problem with this issue! Bill correctly points Anna to InteractiveFrameUpdate.

    You might have thought — as I always do, and then I have a problem similar to Anna’s — that you could create the InteractiveFrame with that flag set, so that “prevent reorganization” is false (that is, “allow reorganization,” which is not what it’s called, is true… :).

    But you can’t. Mostly. You have to create the Frame and then update it. As I have learned repeatedly. In case it might be useful so some poor sod following in our footsteps, some code that (currently) works:

    
    await codapInterface.init(this.iFrameDescriptor, null)
    //  now update the iframe to be mutable...
    const tMessage = {
        "action": "update",
        "resource": "interactiveFrame",
        "values": {
            "preventBringToFront": false,
            "preventDataContextReorg": false
        }
    };
    const updateResult = await codapInterface.sendRequest(tMessage);
    

    Oddly, it also seems to be the case that if you make more than one data context (more than one table), the second one can be reorganized. This leads us to wonder whether, perhaps, the flag should be attached to the data context (a.k.a. dataset, table) rather than to the entire iFrame, that is, to the entire plugin. I think the Wizards of Emeryville are considering this.

    • This reply was modified 5 years, 6 months ago by Tim Erickson.
    • This reply was modified 5 years, 6 months ago by Tim Erickson.
Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.