Jump to content

Inserting Alphabetically into a MPTT tree?


msing

Recommended Posts

Hey there,

 

I actually came to the forums because I was neck deep in my code trying to find out why deleting items out of my MPTT tree was causing problems. Funnily enough I couldn't explain my situation without drawing it out in mspaint, and go figure it became clear after a while of drawing and studying my own drawing.

 

Anyway, I realized that there seems to be no obvious way to insert data into a MPTT tree without putting your inserted item as the LAST child of an existing node. I would really like to be able to insert data into my tree in its proper alphabetical position. Of course I can always re-run my function that re-structures the table into MPTT form from the stored parent node info (kept specifically for that reason). But I was hoping I could find a way to do this without running that cursed recursive function.

 

Any insights? Thanks.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.