0

I am trying to configure a menu for my CMS I want to be able to use Nested Sortables just like you have
in WordPress.

The problem Im having is getting my head around how I am going to start I already have a column
in my database table called page_order and that is sorted in order using Jquery ui sortable, but
If I want to use a multiple dropdown menu how would I sort this in the database table would I
need two table columns i.e. menu_cat & menu_item and once the data is posted with jquery how would
I store that in the correct order.

Im just stuck with the logic on how I am going to do this if anyone has any suggestions I'm all ears.

I want to use the following nested sortable plugin,

http://mjsarfatti.com/sandbox/nestedSortable/

https://code.google.com/p/nestedsortables/wiki/NestedSortableDocumentation

2
Contributors
2
Replies
7
Views
4 Years
Discussion Span
Last Post by mbhanley
0

@mbhanley

If I want to use a multiple dropdown menu how would I sort this in the database table would Ineed two table columns i.e. menu_cat & menu_item and once the data is posted with jquery how wouldI store that in the correct order.

Why can't you used just a regular drop down menu form?

Something like this:

<form id="" name="" method="post" action="drop.php" >
<input type="hidden" name="edit" value="yes" />
<?php
$query = "Select column1, column2 FROM table ORDER BY id";
$result = mysql_query ($query);
echo "<select name=post value=''>Option</option>";
while($nt = mysql_fetch_array($result)){
    echo "<option value=$nt[column1]>$nt[column2]</option>";
}echo "</select>";
?>
<input type="submit" name="submit" id="submit" value="Submit" />
</form>

So you can just update menu_cat & menu_item by using that.

It's confusing what you are trying to do. I think it will be more simple staying with PHP & MYSQL than using JQuery as part of the equation. I'm not familiar with JQuery so this is all I can help you.

Edited by LastMitch: grammer

0

Thanks LastMitch, I know what I am trying to acheive is very complicated but
if I didn't at least try to understand Jquery and Nested sets I would not
understand programing at all to this day.

I do find Jquery a little complicated but I always work out how to do what I want eventualy.

I am reading up on Nested sets and storing hierarchical data at the moment if I manage
to sus it all out I will make an example of how to do this and post it on my blog for
others.

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.