requestAction('/controller/showcart'); /* this call is not necessary. You can use it to fill the
with some content to start with */ ?>
dropRemote('cart',null,array('url' => '/controller/addarticle/','with'=>'{draggedid:element.id}','update'=>'cart')); echo $ajax->dropRemote('thrashbin',null,array('url' => '/controller/removearticle/','with'=>'{draggedid:element.id}','update'=>'cart')); /* these two calls make objects with DOM id's 'cart' and 'thrashbin' droppable. When an object is dropped into them, the actions defined by 'url' are called. The 'with'=>'{draggedid:element.id} passes the id of the dropped element to the function that is called (on the background, no page refresh or anything like that!). The update thing makes sure that the entire output of the requestAction call is displayed inside the
So that means that the page will update the part of the page which is specified (dom id 'cart') when the output from the requestAction call is received */ ?>
drag($article['Article']['id'],array('revert'=>true)); /* the revert thing will make the draggable return to it's original position. Set this to false and the object will stay where you put it. This does not have anything to do with a function call being made btw, that's the job for the draggables */?>
requestAction('/controller/showcart'); /* this call is not necessary. You can use it to fill the
with some content to start with */ ?>
dropRemote('cart',null,array('url' => '/controller/addarticle/','with'=>'{draggedid:element.id}','update'=>'cart')); echo $ajax->dropRemote('thrashbin',null,array('url' => '/controller/removearticle/','with'=>'{draggedid:element.id}','update'=>'cart')); /* these two calls make objects with DOM id's 'cart' and 'thrashbin' droppable. When an object is dropped into them, the actions defined by 'url' are called. The 'with'=>'{draggedid:element.id} passes the id of the dropped element to the function that is called (on the background, no page refresh or anything like that!). The update thing makes sure that the entire output of the requestAction call is displayed inside the
So that means that the page will update the part of the page which is specified (dom id 'cart') when the output from the requestAction call is received */ ?>
6 - popo (05/09/2011 07:29:31 AM)lolo
7 - a (08/01/2012 03:14:56 AM)adsfa
8 - aaa (09/18/2014 09:05:26 PM)xxx
9 - gggg (09/05/2011 08:46:49 PM)ggg
10 - aaa (11/05/2016 01:33:30 PM)scdc
11 - test fb2 (04/07/2015 10:06:41 AM)test fb2
12 - asfas (06/12/2010 05:52:19 PM)fasf
13 - 333333333333 (05/25/2012 03:35:20 PM)4444444444444444444
14 - aatest (04/19/2013 02:38:20 AM)19apr13es
15 - tyhhh (07/28/2014 01:55:17 PM)ggfg
16 - cacca (03/02/2012 10:09:04 AM)cacca
17 - 1111111111111111111 (05/25/2012 03:34:32 PM)2222222222222222222222222222222
18 - 001 (12/14/2011 12:59:33 PM)00100100100
19 - Fish (08/23/2011 04:54:07 AM)I LIKE FISH!!!
20 - 1 (05/03/2012 05:15:54 AM)1
21 - b v (11/13/2013 03:41:14 AM)b v
22 - voici ce qui est (04/27/2011 02:19:34 PM)et ce qui sera
23 - kjnkh (01/04/2012 10:18:35 AM)h
24 - mi Prueba (03/29/2013 11:29:20 PM)Aqui voy a escribir cualquier informacion que me permita validar el ejemplo.
25 - sdfsdfsdf (02/23/2011 07:26:53 AM)dsfg dsfgsdfg
26 - manjeera (10/23/2013 04:08:02 AM)test
27 - test (05/09/2012 09:44:56 AM)test
28 - micca 1234 (03/08/2013 04:37:19 AM)ssss
29 - szser (07/25/2011 05:08:39 PM)tg45twe
30 - test (07/06/2011 01:05:16 PM)mdsk*fmksdfklmsfklms
31 - xsa (04/12/2011 07:57:31 AM)xsaxsa
32 - Test 2 (03/18/2009 10:40:35 AM)
33 - fdhdfh (05/16/2011 08:25:23 AM)dfhdfhd
34 - dfsdfsd (09/27/2011 08:39:15 AM)dsfsdf
35 - к2кцук (06/02/2011 09:13:17 AM)цукцук
36 - eyery (05/16/2011 08:25:07 AM)ryery
37 - test (02/22/2011 07:13:24 AM)tessst
38 - test test (03/23/2011 12:20:53 PM)Hello world
39 - arunabha (10/07/2010 01:05:27 AM)He is a good boy.
40 - Test (04/12/2011 07:59:15 AM)This's my test
41 - blah (03/23/2011 11:38:50 AM)Hello world
42 - test (04/21/2011 01:23:05 PM)
43 - ade (04/07/2011 12:45:59 PM)xsew
44 - Jayaram (03/10/2011 04:03:33 PM)
45 - erret (12/09/2010 02:25:25 PM)retret
46 - hhhh (12/10/2008 09:58:16 PM)hhhh
47 - SaradaPrasad (02/24/2011 06:20:35 AM)Hi How are u
48 - DDD (05/06/2011 05:02:55 PM)DDD
49 - hsdfgsdf (03/17/2011 03:04:55 PM)gsdfg
50 - xsax (04/12/2011 07:58:08 AM)saxsxsa
51 - sdsd (07/26/2010 05:12:08 AM)sdsdsdsd
52 - test 2 (08/13/2010 12:23:29 PM)body
53 - rturt (01/06/2011 09:01:43 AM)urturtu
54 - zaz (04/26/2011 10:00:18 AM)azaz
55 - AAAABBBB (11/17/2010 09:00:21 AM)ABC
56 - manish (01/31/2011 04:51:01 AM)test
57 - testok (07/20/2010 12:23:23 PM)test
58 - Test (01/21/2011 01:39:56 PM)Prueba de funcionamiento de la aplicacion
59 - c (12/14/2010 03:20:40 PM)cx v
60 - 222 (09/03/2010 03:12:19 AM)22
61 - zfgn (11/30/2010 08:00:46 AM)x fnxf jnx jmtm
62 - fsdfsd (10/26/2010 12:09:32 PM)sfsdfs
63 - qwwe (10/28/2010 06:04:02 AM)qe
64 - Amma (01/04/2011 06:11:45 AM)TCS
65 - testing mail (02/24/2010 11:37:13 AM)hi all
66 - HoHo (09/16/2010 03:15:00 PM)Oo
67 - adriano (09/10/2010 03:02:53 AM)
68 - Abhisek (10/07/2010 01:13:32 AM)Good Morning
69 - sdfg (12/01/2010 08:47:18 AM)sdgsdfg
70 - SAM (07/24/2010 07:59:30 PM)call him at 12am
71 - Testomini (07/13/2010 06:36:06 AM)Toostoo
72 - 123 (07/09/2010 07:56:53 AM)123
73 - sa (08/17/2010 03:05:19 AM)sa
74 - sfsd (03/02/2010 09:52:38 PM)fdsf
75 - test by ton (05/06/2010 02:09:08 AM)my name is tong
76 - reerr (09/21/2010 07:45:03 PM)rrrrrrr
77 - wqqwq (04/27/2010 07:14:01 AM)assaa
78 - dddddd (05/31/2010 11:29:42 AM)ddddd
79 - ghhhh (05/07/2010 09:10:28 AM)
80 - devesh (01/14/2010 11:11:55 PM)hellp
81 - Drag'n Drop (06/14/2010 01:31:31 PM)goood :)
82 - rr (04/29/2010 02:51:09 PM)mm
83 - ee (04/16/2010 03:30:38 AM)ee
84 - sfsf (10/22/2009 11:12:01 AM)werwer
85 - gadfg (03/18/2010 09:06:43 PM)sdfsadf
86 - a (02/03/2015 02:01:03 AM)a
87 - Test Add (09/04/2009 12:52:01 AM)this is a test...
88 - 特色t (10/22/2009 03:07:41 AM)上的发生地
89 - TNE (01/15/2009 03:24:11 AM)www.topdanmar.dk
90 - test (05/04/2010 10:17:18 PM)test
91 - qqq (06/28/2010 09:18:56 PM)
92 - pizza (02/05/2009 09:43:47 AM)pizzahut
93 - vk (02/05/2010 03:47:55 AM)vk
94 - 55 (06/12/2009 02:18:57 AM)55
95 - Poopy (02/23/2010 08:19:39 PM)Poopy.
96 - testsam (07/12/2010 07:36:04 AM)asdfasdfdf
97 - Teste (04/20/2010 09:04:48 PM)Teste
98 - cvbcv (01/17/2010 09:35:42 AM)cvb
99 - Jar (09/26/2010 03:26:29 PM)this is sooooooooo cool
100 - TESTE (02/18/2010 08:25:53 AM)dsa
I know what you're thinking. How do I know the documents have really been updated in the database? Well, to prove this, move an item in the list. The message will say the update has taken place. Now refresh the browser page. Notice how the items retain the order you gave them and that the sort number for each one updates.
If Ajax doesn't work for you use this button instead
Note:
When new children are added they get given a default sort order of "0". They will remain at the top and will be sorted by date added (most recent at top). It's not until you next (first?) force an update that these new children get given a real order.