I know my PHP and MySQL but am pretty weak on Javascript so I rely on existing frameworks and snippets to get me by. I am currently looking for a way to sort and group elements.
A step in the right direction seems to be found at:
But what I want to do involves the following data example:
id|parent_id|item
1|0|fruits
2|0|vegetables
3|0|apples
4|0|pears
5|0|corn
6|0|Granny Smith
The user would be presented with a list that looks like this:
fruits
vegetables
apples
pears
corn
Granny Smith
The user would then drag elements around so that the database would be instantly updated to this:
id|parent_id|item
1|0|fruits
2|0|vegetables
3|1|apples
4|1|pears
5|2|corn
6|3|Granny Smith
And then the user would see something like this:
fruits
--apples
----Granny Smith
--pears
vegetables
--corn
I'm basically looking for the same functionality of any operating system's method of drag-n-drop file management - - - but I seem to be using the wrong keywords to search for something like this. The examples that I am finding only sort order in a list - - they do not offer the sub-grouping required in this sample.
Can someone point me to a good resource or existing library/framework for this?
A step in the right direction seems to be found at:
But what I want to do involves the following data example:
id|parent_id|item
1|0|fruits
2|0|vegetables
3|0|apples
4|0|pears
5|0|corn
6|0|Granny Smith
The user would be presented with a list that looks like this:
fruits
vegetables
apples
pears
corn
Granny Smith
The user would then drag elements around so that the database would be instantly updated to this:
id|parent_id|item
1|0|fruits
2|0|vegetables
3|1|apples
4|1|pears
5|2|corn
6|3|Granny Smith
And then the user would see something like this:
fruits
--apples
----Granny Smith
--pears
vegetables
--corn
I'm basically looking for the same functionality of any operating system's method of drag-n-drop file management - - - but I seem to be using the wrong keywords to search for something like this. The examples that I am finding only sort order in a list - - they do not offer the sub-grouping required in this sample.
Can someone point me to a good resource or existing library/framework for this?