Thanks for the help firstly :)
It does clarify, I know that "chunksList" needs to go in serialise
(content) - I think, just not sure how to access that in the script.
Here is the parts of the code, its possible I have made an error:
from the script:
function startup()
{
Sortable.create("chunksList", {tag:"li"});
}
function serialise(listID)
{
var length = document.getElementById(listID).childNodes.length;
var serialised = "";
for (i = 0; i < length; i++)
{
var li = document.getElementById(listID).childNodes[i];
var id = li.getAttribute("id");
// add number to serialised array
serialised += encodeURIComponent(id) + "_";
}
// returns array (with last "_" removed
return serialised.substring(0, serialised.length - 1);
}
--- and also the original code fragment.
then from chunkslist.class.php - chunks are the items of data going
into the list
case 'recreateList':
$reOrder = explode('_', $content);
for ($i=0; $i < count($reOrder); $i++)
{
$new_order[$i] =
$this->mysqlConnection->real_escape_string($reOrder
[$i]);
$result = $this->mysqlConnection->query('UPDATE chunks SET
order_no="' . $i . '" WHERE id="' . $reOrder[$i] . '"');
}
$recreatedList = $this->BuildChunksList();
return $recreatedList;
break;
Thanks again for taking the time
On Feb 23, 12:58 pm, Walter Lee Davis <[email protected]> wrote:
> content.serialize() could be re-written as "variable you set to the
> return of Sortable.create".serialize();
>
> var foo = Sortable.create('somDomElement',{});
>
> ...
>
> var sortOrder = foo.serialize();
>
> Does that help?
>
> Walter
>
> On Feb 23, 2009, at 7:00 AM, vanq69 wrote:
>
>
>
> > ANY help would be greatly appreciated, I think the rest of my code for
> > dealing with placing it into the database etc is correct as it worked
> > before so im fairly confident its just this line.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Prototype & script.aculo.us" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/prototype-scriptaculous?hl=en
-~----------~----~----~----~------~----~------~--~---