Sign In| Join
Get Help:Ask a Question in our Forums|Report a Bug|More Help Resources
Last post May 05, 2012 07:53 PM by francesco abbruzzese
0 Points
9 Posts
May 05, 2012 02:55 PM|LINK
Hi,
The problem ----------------
I have a list of items that are always the same Like:
Basketball Football Golf Hocky
And i have created a list with jQuery UI sortable that works just fine: http://jqueryui.com/demos/sortable/
Now i have to save the order of those items in database fields Like:
public string pos1 { get; set; } public string pos2 { get; set; } public string pos3 { get; set; } public string pos4 { get; set; }
So basketball will go in pos1, football will go in pos2,...
How do i do this?
List:
<ul id="sortable"> <li>Basketball<input type="checkbox" value="1" /></li> <li>Football<input type="checkbox" value="1" /></li> <li>golf<input type="checkbox" value="1" /></li> <li>others<input type="checkbox" value="1" /></li> </ul>
Star
8376 Points
1573 Posts
May 05, 2012 03:09 PM|LINK
Google/Bing will give many examples of this. Here is one:
http://www.wiseguysonly.com/2008/12/07/drag-and-drop-reordering-of-database-fields-sortables-with-jquery/
May 05, 2012 03:17 PM|LINK
Thanks for the reply, but through my limited programming knowledge, i realy need a exaple that implements it in MVC.
May 05, 2012 03:33 PM|LINK
I need this
http://forums.asp.net/p/1650626/4292348.aspx#4292348
in MVC with my example of the top, can anyone help me with this. Im realy stuck on this.
All-Star
20912 Points
3279 Posts
May 05, 2012 07:53 PM|LINK
In this blog post: http://www.dotnet-programming.com/post/2010/11/15/Defining-MVC-Controls-3-Datagrid-Sorting-and-Master-Detail-Views.aspx
and in the associated code sample there is an example of use of the Mvc Controls Toolkit SortableListFor that do all the job you need.
mathias BE
0 Points
9 Posts
Mvc Jquery Sortable, save order to table
May 05, 2012 02:55 PM|LINK
Hi,
The problem
----------------
I have a list of items that are always the same Like:
Basketball
Football
Golf
Hocky
And i have created a list with jQuery UI sortable that works just fine: http://jqueryui.com/demos/sortable/
Now i have to save the order of those items in database fields Like:
public string pos1 { get; set; }
public string pos2 { get; set; }
public string pos3 { get; set; }
public string pos4 { get; set; }
So basketball will go in pos1, football will go in pos2,...
How do i do this?
List:
RichardY
Star
8376 Points
1573 Posts
Re: Mvc Jquery Sortable, save order to table
May 05, 2012 03:09 PM|LINK
Google/Bing will give many examples of this. Here is one:
http://www.wiseguysonly.com/2008/12/07/drag-and-drop-reordering-of-database-fields-sortables-with-jquery/
mathias BE
0 Points
9 Posts
Re: Mvc Jquery Sortable, save order to table
May 05, 2012 03:17 PM|LINK
Thanks for the reply, but through my limited programming knowledge, i realy need a exaple that implements it in MVC.
mathias BE
0 Points
9 Posts
Re: Mvc Jquery Sortable, save order to table
May 05, 2012 03:33 PM|LINK
I need this
http://forums.asp.net/p/1650626/4292348.aspx#4292348
in MVC with my example of the top, can anyone help me with this. Im realy stuck on this.
francesco ab...
All-Star
20912 Points
3279 Posts
Re: Mvc Jquery Sortable, save order to table
May 05, 2012 07:53 PM|LINK
In this blog post: http://www.dotnet-programming.com/post/2010/11/15/Defining-MVC-Controls-3-Datagrid-Sorting-and-Master-Detail-Views.aspx
and in the associated code sample there is an example of use of the Mvc Controls Toolkit SortableListFor that do all the job you need.
Mvc Controls Toolkit | Data Moving Plug-in Videos