I haven’t written anything in a long time so I figured it is time to write something up. Because a huge portion of my traffic seems to be related to my scriptaculous examples I’ve put up, I figured I’d add another one that covers the process of updating a database with the results of drag/drop with an Ajax call. Each time the user changes an item’s position in the list it updates the database.
See the example (note: example uses Scriptaculous 1.7 Beta 2)
The methodology behind this is quite simple:
- Load the list values from the DB and show them on the screen
- Using JavaScript, setup the sortables
- Add a JavaScript callback to the drag/drop that points to a function that serializes the list and sends an Ajax request to the server
- On the server, loop through the list and update the database with the proper order
To do this I created three main files:
- index.php – the UI that shows the list and has the JavaScript
- ajax.php – the page that processes the Ajax request
- db.php – a simple database class included in both index.php and ajax.php that makes the connection to the DB and has methods to get the current list and to update the list
Reviewing Index.php
Index.php looks like this:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 | <? require('db.php'); $demo = new SortableExample(); $list = $demo->getList(); ?> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> <html> <head> <title>Scriptaculous 1.7 Sortables Ajax Example</title> <link rel="stylesheet" type="text/css" href="style.css"> <script src="js/prototype.js"></script> <script src="js/scriptaculous.js"></script> <script> Event.observe(window,'load',init,false); function init() { Sortable.create('listContainer',{tag:'div',onUpdate:updateList}); } function updateList(container) { var url = 'ajax.php'; var params = Sortable.serialize(container.id); var ajax = new Ajax.Request(url,{ method: 'post', parameters: params, onLoading: function(){$('workingMsg').show()}, onLoaded: function(){$('workingMsg').hide()} }); } function handleResponse(req) { // this function will fire after the ajax request is complete...but we have nothing to do here } </script> </head> <body> <h2>Scriptaculous Sortables Demo with Ajax Callback</h2> Built with Scriptaculous 1.7 Beta 2. Drag items in the list below. Each time you update the list an Ajax call is made that updated the database with the new order.<br><br> <div id="listContainer"> <? foreach($list as $item) { ?> <div id="item_<?=$item['catid'];?>"><?=$item['category'];?></div> <? } ?> </div> <div id="workingMsg" style="display:none;">Updating database...</div> </body> </html> |
Let’s look at this in reverse order. At the bottom of the file there is a div with id ‘containerDiv’ (line 36). This is the container for our list. Within this is a small snippet of PHP that loops through an associative array and prints out each list item as a div with id ‘item_12′ where 12 is the ID for that record in the database (line 40). Lines 2-4 contain the PHP code that include the db.php file and use it’s class to get the associative array that is used here.
Underneath the container div is another div that has the text ‘Updating database…’ – this div is hidden by default and will be shown while Ajax calls are in progress (line 45).
Now to the JavaScript…it starts off on line 14 with a call to Event.observe that tells the browser to call the init function after the page loads. The init function (line 15) creates a new sortable list on the listContainer element, setting all divs within it to be sortable and setting the updateList function as a callback whenever the list is updated. This means that when the order of items in the list change, this function will be called with the list element passed as an argument. This function will perform the Ajax request to update the database.
The updateList function (line 18) first sets a simple variable for the url used for the Ajax request. Next (line 20) it calls Sortable.serialize, passing the id of the container as an argument, which serializes the list to a format such as listContainer[]=5,listContainer[]=7,listContainer[]=2 – here, the first three items of the list would be the items 5, 7, and 2 and the divs representing these items would have the following id values: item_5, item_7, and item_2. This serialized list is set in the variable ‘params’. Next, on line 21, an Ajax request is opened with Prototype’s Ajax.Request class. It is called with two arguments, the url and an object with various options. The options include the type of request (POST in this example, parameters to pass (the params variable constructed on line 20), and two functions (onLoading/onLoaded) that handle the showing and hiding of the ‘Updating database…’ div. Normally in an Ajax request I’d also add a callback for onComplete to handle the response from the server, but in this case the Ajax response doesn’t really matter to me because it is really only a one way communication in this demo – in a real application I’d have more error handling and would need to handle error conditions.
That’s about it for the index page…not too bad, right?
Reviewing ajax.php
The file ajax.php is a simple file that is designed to receive the Ajax request and call the appropriate methods defined in db.php to update the list. Its contents are shown below:
1 2 3 4 5 6 | <? session_start(); require('db.php'); $demo = new SortableExample(); $demo->updateList($_POST['listContainer']); ?> |
Yup, that’s it. Basically it starts off by calling session_start() – I typically call session_start() at the top of pages like this because starting the session sends the right http headers to prevent the file from being cached and I’m too lazy to look up what the right headers are! Next it requires the db.php file, instantiates an object, and calls the updateList method of the object, passing the listContainer variable from the POST request (containing our serialized list). That’s it for the ajax.php page.
Reviewing db.php
The file db.php is a simple database class that connects to the database and has methods to get the list and to update the order of the list. In a ‘real’ application I would definitely have a much cleaner implementation of the database access and would use other DB libraries to connect to the db – I used the simple mysql db functions to minimize on the number of lines needed here. Here are the contents of the file:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 | <? class SortableExample { protected $conn; protected $user = 'test'; protected $pass = 'test'; protected $dbname = 'scriptaculous'; protected $host = 'localhost'; public function __construct() { $this->conn = mysql_connect($this->host, $this->user, $this->pass); mysql_select_db($this->dbname,$this->conn); } public function getList() { $sql = "SELECT * FROM categories ORDER BY orderid"; $recordSet = mysql_query($sql,$this->conn); $results = array(); while($row = mysql_fetch_assoc($recordSet)) { $results[] = $row; } return $results; } public function updateList($orderArray) { $orderid = 1; foreach($orderArray as $catid) { $catid = (int) $catid; $sql = "UPDATE categories SET orderid={$orderid} WHERE catid={$catid}"; $recordSet = mysql_query($sql,$this->conn); $orderid++; } } } ?> |
Important note – this file uses PHP 5 syntax in this object…you’d need some changes to get this to run in PHP 4. I’ll skip talking about the constructor (which connects to the database) and the getList function (which…gets the list) in order to focus on the last method, ‘updateList’. This function takes in an array of items, i.e. array(5,7,2), that come from the serialized list. It loops through the list and generates SQL UPDATE queries for each item. Each time it increments $orderid so that the first item has an orderid of 1, the 2nd an orderid of 2, etc. This means that whenever we get the list, as long as the SQL ‘ORDER BY orderid’ clause is used the list will show in the correct order.
Summary
That’s it…hope you enjoyed it. The hopeful moral of the story is…Ajax is easy, and so is drag and drop….especially if you’re using a good library. Personally I think that Prototype is incredibly useful for JavaScript development and Scriptaculous is a good sidekick for effects and drag/drop. I’ve also used the Yahoo YUI widgets at work where we needed to do some more dynamic widgets such as trees – it worked really well. Jack Slocum’s YUI extension is incredibly well done too…though it’s a heavy one in terms of file size! In the end, it comes down to finding the right tool for the job…
Download the sample application if you want to take a closer look….
January 18th, 2007 at 5:12 pm
Thanks for taking the time to do this, bro. This was something I was planning on teaching myself to implement in the near future, and I’m quite sure you just saved me a ton of time!
Cheers!!
January 22nd, 2007 at 4:36 am
Hi,
Just a note that the SLLists.class.php file in the Zip is missing the closing ?> tag.
Cheers,
Andrew
March 8th, 2007 at 2:29 pm
Very very cool, thank you for this. So, what is required to make the db.php file work with PHP 4?
March 15th, 2007 at 12:29 am
This files are really good and superb…….It is very useful..thanks a lot…
April 12th, 2007 at 5:39 am
This script is really good. I wanted some script like this…. was going to develop one but your code is awesome …
cheers..
G
April 15th, 2007 at 10:37 pm
Hi There,
I need help please.
Excellent script, my problem is, when I reorder, it saves to the database fine, but only saves the first field properly with an ORDERID of 1. everything else is then mixed up not in order….
What am I doing wrong?
Can anyone help?
Please let me know… mattevans@xtra.co.nz
Thanks,
Matt.
April 29th, 2007 at 3:05 pm
I implimented this and I think I can get it all to work, I was wondering if you know how I can make this work if I have multiple lists on one screen?
May 15th, 2007 at 4:41 am
Greg, thank you very much for this. I’ve been battling with Scriptaculous for a while and this class was just what I needed — Scriptaculous without Javascript
May 30th, 2007 at 12:48 pm
Hi there, this looks great but I am having trouble implementing it for some reason . . .
All that shows up on the page is the list container object, but it is empty and at the top is ‘getList(); ?>’.
I don’t know enough about php and classes to figure out why this is happening, but obviously the php function at the top of index.php isn’t succesfully calling getList() from the SortableExample class:
getList();
?>
Any help would be great! You can email me at elihorn@gmail.com
Thanks in advance!
May 30th, 2007 at 1:23 pm
Ok, well I kind of figured it out.
I added ‘php’ after all the ‘
May 30th, 2007 at 11:58 pm
Sorry, I just have one more question if someone can help . . . This is really exactly what I needed! I’m just having trouble working it into my existing framework.
I am trying to impliment this into an existing cms (using DaDaBIK). What I’ve done is put the javascript in a header.php file which is included in index.php as is the ajax.php file and db.php file. The actual sortable list is in another file called business_logic.php.
Anyways, it all works fine (you can drag the entries around and sort everything), except when the updateRecord() function get’s called. For some reason when updateList($_POST['listContainer']) is called from ajax.php, it is not recognizing ‘listContainer’ as it was defined in the javascript in the header.php:
function init() {
Sortable.create(’listContainer’,{tag:’div’,onUpdate:updateList});
}
So when you look at this in the db.php, $orderArray is null:
updateList($orderArray) {
$orderid = 1;
print (”…”.$orderArray.”…”);
foreach($orderArray as $catid) {
$catid = (int) $catid;
$sql = “UPDATE”. $table_name. “SET sort={$orderid} WHERE id={$catid}”;
$recordSet = mysql_query($sql,$this->conn);
$orderid++;
}
Thanks so much! I really appreciate any help you can provide.
Please email me anything to elihorn@gmail.com
June 1st, 2007 at 1:53 pm
Never mind . . . figured it out
June 2nd, 2007 at 5:39 pm
Hi Greg,
First off, thanks for developing these, extremily helpful. Did anyone ever figure out how to make this work with php4? I’m on Yahoo! web hosting so I have to use php4 and I can’t seem to get it to work.
Thanks in advance,
- Jon
June 6th, 2007 at 11:04 am
Hi
Fantastic example, now I have one questiuon, is it possible to have two list and grag item betveen them and autosave?
regards from sweden / johannes
June 6th, 2007 at 12:27 pm
Yes, I also need to make it work on php4. I know, I’m really cluttering up this comment space.
June 10th, 2007 at 12:18 pm
I, too, would love to know how to make it work on php4, please. Can anyone help, please?
June 13th, 2007 at 10:13 am
Here is the script for PHP 4.0. This is what I’m using on my site.
// (mysql.php) sortable functions.. with your database connection etc.
function getList() {
$sql = “SELECT * FROM menus ORDER BY orderid”;
$recordSet = mysql_query($sql);
$results = array();
while($row = mysql_fetch_assoc($recordSet)) {
$results[] = $row;
}
return $results;
}
function updateList($orderArray) {
$orderid = 1;
foreach($orderArray as $catid) {
$catid = (int) $catid;
$sql = “UPDATE menus SET orderid={$orderid} WHERE id={$catid}”;
$recordSet = mysql_query($sql);
$orderid++;
}
}
// (yourpage.php) list tag.. on the page where you want the sortables to be displayed
$list = getList();
//(yourpage.php) javascript.. on the page where you want the sortables to be displayed (same page as the $list = getList(); tag
Event.observe(window,’load’,init,false);
function init() {
Sortable.create(’listContainer’,{tag:’div’,onUpdate:updateList});
}
function updateList(container) {
var url = ‘ajax.php’;
var params = Sortable.serialize(container.id);
var ajax = new Ajax.Request(url,{
method: ‘post’,
parameters: params,
//onLoading: function(){$(’workingMsg’).show()},
//onLoaded: function(){$(’workingMsg’).hide()}
});
}
// (yourpage.php)the foreach loop that grabs the items to be displayed (on the same page)
“>
Hope this helps! If you need help come on over to http://www.boedesign.com
June 25th, 2007 at 5:05 am
Hello,
I want to use this function in my news script (admin area)!
I can’t get the news list with edit and delete button draggeble.. (this data is in a table)
Can anyone give me a tip how i can include this ‘great’ function in my database and script..
Thanks so much! I really appreciate any help..
July 16th, 2007 at 3:14 am
Hi Greg,
A combination of ‘Effect.toggle’ on an DIV (outside the sortable list containers) and a ’sortable list’ with SLLists.class.php on the same page doesn’t work. With scriptaculous_1.7beta.
The sortable list works fine, but the toggle not.
Did you now why ?
Thx a lot !!!
Bobo
July 19th, 2007 at 9:55 am
[...] found this little jem from Greg over at Graphics by Greg the other [...]
August 10th, 2007 at 4:19 am
[...] 详细使用方法 [...]
September 12th, 2007 at 10:52 am
I’ve managed to replicate a problem on three different installs – the sorting works great, but it looks like the call to the ajax function, the show/hide working div and the update query never get called. Is this a bug in the JS library, or caused by something else?
Also – one key element in setting this up is the basic table needed to talk to – here’s what I used (and maybe I’m missing something, hence the update not functioning?):
CREATE TABLE ‘categories’ (
‘catid’ int(2) NOT NULL,
‘orderid’ int(2) NOT NULL,
‘category’ varchar(10) collate utf8_unicode_ci NOT NULL
);
INSERT INTO categories (’catid’, ‘orderid’, ‘category’) VALUES (1, 1, ‘item 1′),
(1, 2, ‘item 2′),
(1, 3, ‘item 3′),
(1, 4, ‘item 4′);
October 4th, 2007 at 8:24 am
Is there any possibility for making this work in multiple columns? Perhaps in a 3-col layout?
This would make for an excellent portal layout handler. I haven’t been very successful at locating a way of managing sortables across columns in addition to Greg’s awesome functionality provided here.
October 8th, 2007 at 10:45 pm
Such a simple thing… here’s the correct INSERT query to get this to run – the catid needs to increment as well!
INSERT INTO categories (’catid’, ‘orderid’, ‘category’) VALUES (1, 1, ‘item 1′),
(2 2, ‘item 2′),
(3 3, ‘item 3′),
(4, 4, ‘item 4′);
With this, one should be able to get this sorting to run smoothly!
October 19th, 2007 at 10:22 am
This is probably a newbie question so please go easy on me. I’ve uploaded all the files from the zip that was provided, created a database and changed to db.php to reflect my database changes. I am getting a parse error. “Parse error: syntax error, unexpected T_STRING, expecting T_OLD_FUNCTION or T_FUNCTION or T_VAR or ‘}” Anyone have any idea why I am such a newbie!?
Thanks in advanced!
November 11th, 2007 at 3:18 pm
Hi all
I using xajax for add / remove from db when xajax update my conteiner, Sortables not work. Where is problem. i`m sorry my english is not very good.
November 21st, 2007 at 12:30 pm
Search for php 5 to php 4 converter on google.. i think the first site that comes up is this:
http://www.dgx.cz/tools/php-5to4/
U can just paste the PHP code in there .. and make the script do the magic for you..
January 3rd, 2008 at 6:44 pm
[...] Sortables with Ajax Callback [...]
January 23rd, 2008 at 6:17 pm
Hey Greg, Everyone,
I’ve been dealing with this but I can’t think of a way to make it happen.
Besides reordering the list with the above script, I need to get the “id_number” of the element that triggered the reordering of the list, do you have any idea how can I pass that parameter?
In brief this is what I need:
1- Reorder a list
2- Save into a user table what he did: ie (move element 8 to position 2)
Any help will be deeply appreciated!
Yak
January 26th, 2008 at 10:36 am
Fantastic example. Once I ran the index.php through http://www.dgx.cz/tools/php-5to4/ it worked, and I managed to modify to work with images. Nice.
My question is how do you enable the horizontal and vertical sorting with the AJAX example?
January 30th, 2008 at 9:37 am
1.) How would I get the PHP/MySQL stuff to work with moving items between groups?
2.) Also, how would one drop the ordering aspect and just update with whichever group the item belongs to?
February 9th, 2008 at 11:16 am
i have this error message :
Parse error: syntax error, unexpected T_STRING, expecting T_OLD_FUNCTION or T_FUNCTION or T_VAR or ‘}’ in db.php on line 3
February 21st, 2008 at 2:59 pm
Hi!
First, Thank you for that List from: http://www.gregphoto.net/sortable/advanced/
I downed it, work on it and made my own callback to get it work in my Backend.
It runs very well. But, shock, me stupid didn´t test it with IE 7.
Under Internet Explorer – Thank you MS – only the lineitems are sortable, not the groups. This is necessary for me.
So, would you help me and tell me what have i to do?
Sorry for my English, its rather bad.
Regards, Tom.
October 13th, 2008 at 8:39 am
[...] Sortables with Ajax Callback [...]
October 24th, 2008 at 9:07 pm
Provillus Review – Best hair loss, hair fall and hair regrowth products for men’s and women’s hair for stop losing hair and grow fast longer and shinning new hair by http://www.managehairloss.com
November 13th, 2008 at 9:16 am
Quick suggestion
The script is great ! One change though,
the line where it says the database has been updated, it displays so quickly it looked more like a glitch than confirmation. So I added a line to have it display for a second (1000) so that it can be easily read.
in the JavaScript change the following line:
Change From:
onLoaded: function(){
$(’workingMsg’).hide()}
Change To:
onLoaded: setTimeout(function(){
$(’workingMsg’).hide()},1000)
December 6th, 2008 at 5:19 am
I tried nesting some lists and only could get 2 deep in nested list but couldnt get 3rd. Is there a limitation?
January 8th, 2009 at 4:24 pm
[...] علي جهازي بالعمل علي العموم يمكنك تحميل هذا السكربت Graphics by Greg واطلع علي ملفاته .. وستفهم الالية المتبعة جيدا ويمكنك [...]
February 10th, 2009 at 4:44 am
Brilliant tutorial man. This is what I searched for
February 16th, 2009 at 4:33 am
[...] UI focusing more on API, Plugins, Themes and Effects>> saved by edupalet 38 days ago5 votesGraphics by Greg " Blog Archive " Scriptaculous Sortables with Ajax>> saved by bcswartz 39 days ago2 votesLily Is Launched>> saved by pruffing 53 days ago2 [...]
March 31st, 2009 at 11:45 am
I think that this code work fine when the item list handle 30 or 100 elements , but if you have a list with 15000 items, and you need to re-order only one item, the UPDATE process need to execute all the UPDATEs operation….so the response time can be affected and the interaction with the user end in a slower system.
Think, If you have 5 persosn eah one doing re-ordering operations, each one with 10.000 items (example: a product gallery )…you kill the DATABASE or the response time and the AJAX “magic”.
So, i do a similar thing but if you have 10.000.000 itms, an dyou need to re-order only one, don’t need to Kill the database for the UPDATE.
Only update the order of the selected item, I use MySQL5 and Stored procedures o course:
DELIMITER $$
DROP PROCEDURE IF EXISTS `shddb`.`sp_shd_acciona_productos_ordenar` $$
CREATE DEFINER=`root`@`%` PROCEDURE `sp_shd_acciona_productos_ordenar`(
IN v_id int,
IN v_orden int
)
DETERMINISTIC
BEGIN
SET @id_destino=(SELECT id_pk FROM shd_productos_acciona WHERE orden=v_orden);
SET @orden_destino=(SELECT orden FROM shd_productos_acciona WHERE id_pk=v_id);
UPDATE shd_productos_acciona SET orden=v_orden WHERE id_pk=v_id;
UPDATE shd_productos_acciona SET orden=@orden_destino WHERE id_pk=@id_destino;
END $$
DELIMITER ;
And only UPDATE 2 records.
So if you have a real world application use a STRONG business logic, don’t send a POST containing an array with all the items when you need to reorder 1.
See ya.
April 2nd, 2009 at 10:39 am
Graphics by Greg » Blog Archive » Scriptaculous Sortables with Ajax Callback…
I haven’t written anything in a long time so I figured it is time to write something up. Because a huge portion of my traffic seems to be related to my scriptaculous examples I’ve put up, I figured I’d add another one that covers the process of upda…
April 15th, 2009 at 7:40 am
when I alter a category into a link in a data base
e.g.this link “Galleries” then everything works perfectly in every broser except the internet explorer 7 , would you please help me to improve this problem or advice me anything ?
I would be very grateful if you coontact me on the following address: davit.agniashvili@gmail.com
April 27th, 2009 at 9:16 am
I just wanted to give you a big thanks! works great!
May 4th, 2009 at 8:04 pm
[...] more here: Graphics by Greg " Blog Archive " Scriptaculous Sortables with Ajax Callback Share and [...]
June 27th, 2009 at 9:04 pm
I used long time ago this script and it works perfectly… now I tried in another server and I had problems with the php5 code… the error was
Parse error: syntax error, unexpected T_STRING, expecting T_OLD_FUNCTION or T_FUNCTION or T_VAR or ‘}’ in db.php on line 3
After burn me brain out for hours… I found the solution.
I went to this page http://php7.org/tools/5to4/ and It transform the code php5 to php4
conn = mysql_connect($this->host, $this->user, $this->pass);
mysql_select_db($this->dbname,$this->conn);
}
function getList() {
$sql = “SELECT * FROM tablename ORDER BY porder ASC”;
$recordSet = mysql_query($sql,$this->conn);
$results = array();
while($row = mysql_fetch_assoc($recordSet)) {
$results[] = $row;
}
return $results;
}
function updateList($orderArray) {
$porder = 1;
foreach($orderArray as $id) {
$id = (int) $id;
$sql = “UPDATE tablename SET porder={$porder} WHERE id={$id}”;
$recordSet = mysql_query($sql,$this->conn);
$porder++;
}
}
function SortableExample() /* PHP 4 constructor */
{
// call php5 constructor
$args = func_get_args();
call_user_func_array(array(&$this, ‘__construct’), $args);
}
}
?>
This scritpt is excellent! thank you!
July 16th, 2009 at 1:08 am
Discover the best penis enlargement products, that reviews by best penis enlargement consumer review result to get the best penis enlargement products that really works. get the real penis enlargement truth at http://www.penis4enlargement.com
July 26th, 2009 at 10:54 am
Hi, i was trying this example and is awesome,
the only problem is that i get the update database… sometimes and it not hide :/ anyone have any idea how can i fix this?. thanks
August 19th, 2009 at 3:54 am
Nice sample pal, keep it up
August 24th, 2009 at 2:28 am
Nice script!
mibo:
Read up and do the : onLoaded: setTimeout(function(){$(’workingMsg’).hide()},1000)
thingy. That will fix your glitch
September 14th, 2009 at 7:12 pm
All works fine buty
there is just one question. I want that the Sortable List looks like that
| Sortable List |
| |
| [ Box 1 div to Drag the Box 1 ] |
| | Box 1 div content | |
| [ Box 1 div footer ] |
| |
| |
| [ Box 2 div to Drag the Box 2 ] |
| | Box 2 div content | |
| [ Box 2 div footer ] |
| |
| |
| [ Box 3 div to Drag the Box 3 ] |
| | Box 3 div content | |
| [ Box 3 div footer ] |
I don’t know how to edit the code:
<div id="item_”>
I tryed like that:
Content box 4 the Shoubox Snippet codeFooter
Content box 4 the User Online Snippet codeFooter
Content box 4 ….Footer
But it didn’t work.
It is also importent for me that I can give each content div a Individuel Text,
because I use a Content Managment System that use Snippets for the content.
It would be very nice if someone could help me Thx.
September 14th, 2009 at 7:16 pm
Sorry i dont know wy he dont show in the post the html code.
But i hope you know what i mean.
January 27th, 2010 at 8:56 pm
Thanks for the script it works great. Is there a way to have it update the database onload. I am creating items for the list on a different page, when done the list appears with your new item in it. But the new item’s order # is 0 until you drag something. The order is displayed so i would like it to drop in and be number 1 not 0. I tried a couple things with no luck.
Thanks for your Help.
March 1st, 2010 at 9:14 am
Hey, I’ve got this setup and working in an iFrame page. When I try to drag the elements to the edge of the visible page I’d like it to scroll for me… if I have a very long lists (which I do). Anyone know how this is possible?