CODAP › Forums › CODAP Help Forum › Creating a parent-level collection from a data interactive
- This topic has 3 replies, 3 voices, and was last updated 6 years, 2 months ago by Tim Erickson.
-
AuthorPosts
-
Anna FergussonParticipant
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
August 29, 2017 at 2:47 pm #394Bill FinzerKeymasterHello Anna,
There are at least two things going on here:
- 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.
- 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
August 30, 2017 at 9:45 am #395Anna FergussonParticipantHello 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
October 4, 2018 at 2:33 pm #744Tim EricksonParticipantLet 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 6 years, 2 months ago by Tim Erickson.
- This reply was modified 6 years, 2 months ago by Tim Erickson.
-
AuthorPosts
- The forum ‘CODAP Help Forum’ is closed to new topics and replies.