Well, I finally went back to have a look at this problem and found a
better way around it.
Essentially each list (LI) item that you add can have additional
attributes added to it, i.e. :
I'm an item example
When moving it, I can change that attribute with the following code :
$item.attr("Start
Hello again,
I'm still getting no joy with this - even when using the MoveToCargo
function and setting the value directly before the appending of the
information.. it's still copying across the old value. I've worked
out a code route around it (by putting all the values of objects into
an array
Hello again,
I've worked out where my problem is..
When I've moved an item from the, in this case, hanger to the cargo
(as in dragged an item from my "hanger" box to my "cargo" box) it
create and item, removes it from the Hanger.. and appends it to the
cargo. However, when it appends it to the
Richard, thank you very very much - I realise, looking up through the
code again, that I was being a bit thick with that last message!
On Mar 27, 3:01 pm, "Richard D. Worth" wrote:
> Set a new value when it's in a new place
>
> $item.data("location", "newValue")
>
> - Richard
>
> On Fri, Mar 27,
Set a new value when it's in a new place
$item.data("location", "newValue")
- Richard
On Fri, Mar 27, 2009 at 10:57 AM, Paul Hutson
wrote:
>
> Richard,
>
> Fantastic - just what I was looking for!
>
> I now know where the item starts.. however, when it gets to the new
> location.. how do I reas
Richard,
Fantastic - just what I was looking for!
I now know where the item starts.. however, when it gets to the new
location.. how do I reassociate the item with it's new home.. it seems
to copy across the information.
I'm using the following code to move the item :
// Move to Cargo
Something like this, perhaps?
$("#draggable").draggable({
start: function() {
$(this).data("location", "RIGHTBOX");
}
});
$("#droppable").droppable({
drop: function(event, ui) {
alert(ui.draggable.data("location"));
}
});
- Richard
On Fri, Mar 27, 2009 at 4:58 AM, Paul Hutson wro
Thanks for the reply Shedokan.. I'm not quite sure I'm following you
though. ... when I say the origin, I want to - upon clicking on an
item, assign it with a start location variable (scope, or something
else.. with say a value of "RIGHTBOX") then when I drop it somewhere I
want to be able to read
If your'e calling it inside a function of the draggable so you can use
$(ui.draggable).draggable('option', 'scope') because there is no
ui.draggable
alose if you mean that you want to get the left and top position you
can use ui.offset.
On 26 מרץ, 16:57, Paul Hutson wrote:
> As a bit of an addo
As a bit of an addon... the thing I really want to do is find out
draggable objects origin location is.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"jQuery UI" group.
To post to this group, send email to jquery-ui
10 matches
Mail list logo