ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

SafeCracker + AJAX => How to update 2 entries in 2 different channels with a single submit.

May 12, 2012 10:09am

Subscribe [1]
  • #1 / May 12, 2012 10:09am

    ChiefAlchemist

    913 posts

    Here’s the proposed UX / “workflow”...

    Step 1 - Member uploads 1 to 10 files to a channel. Let’s call that channel Files. Eventual they would click a “Uploading complete” button and would be taken to…

    Step 2 -Present a list of the files that where just uploaded and allow the Member to “configure” each file. The best example I can give, is imagine the Files uploaded as images and the “configuring” as indicating which size t-shirt they want the image printed on. (Note: This is just an example, for the sake of discussion. It’s not what the client really does. Please pardon the secrecy. Thx)

    And this where it gets kinda funky…

    - The “configuring” will create a record in a second channel. Call it T_Shirts.

    - As that entry is created I also need to update the Files entry in some way such that the size just configured would no longer be an option. That is, a file + size can only be “configured” once. We don’t want a member to be able to “double order”. That is, a size for a give Files entry can only be “configured” once.

    Got it so far? 😊

    The UX as it’s currently envisioned would be AJAX driven. Imagine something along the lines of a list of Files entries, along with a list of radio buttons (for the sizes) below each. Pick the radio (or dropdown), submit, that radio option disappears, the T_Shirt row is created and a ajaxSuccess() message jQuery’ed into the markup somewhere.

    Note: The configuring stage could happen today and then again in 2 weeks or 2 month. The member(s) would always have access to their Files and would always be able to choose an entry from Files and “configure” it. Provided that the “size” had not been previous configured.

    A couple more things…

    1) If it helps, A member could have anywhere from 5 to 500 entries in Files. Perhaps, at most 1000 rows. I’m thinking I could - if necessary - SELECT all their T_Shirting into an array and then use that to “filter” out what has already been configured as I’m displaying the configure screen. Or maybe it’s a custom SQL statement? And somewhat related…

    2) I don’t believe - at this time - that there is a need for an ongoing relationship between Fields and T_Shirts. For example, I don’t necessarily need Playa or similar. In fact, it’s important that T_Shirts be its own channel. Once the Files become T_Shirts there’s other magic to work.

    Finally, I’m certainly no AJAX guru. The idea certainly seems possible. The question is, how practical (in time) is it? If you have any suggestions please type slow and spoon feed it to me. I’m not in over my head. I just want to up my game a bit 😉

    Thanks in advance
    Mark

     

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases