That sounds like a likely candidate.
I'd bet this tutorial will be helpful:
And in the controller, use the model functions:
Use $this->YourModel->findByUser_id($user_id) to try to get a result.
If you get one, save the new values with $this->YourModel->save($newValues).
If not, call $this->YourModel->create() before the save().
Have Fun!
Eric
On 10/22/06, Eric <[EMAIL PROTECTED]> wrote:
Thanks Eric...hehe (another Eirc)
The cakephp AJAX library (prototype , script.aculo.us) seems just have
endDrag() ,which is "caught by the window's mouseup, stops dragging
the activeDraggable, if any, via its endDrag function. "
Is it the function?
More appreciate if you can post some code for the controller
Thanks.
Eric C Blount wrote:
> 1) Create a table with id,user_id,positionx,positiony
> 2) Create a model for that table
> 3) In your AJAX library, see if there's a callback function like afterDrag()
> that you can call to send the x and y values with an ajax request
> 4) In the controller, store the values
> 5) On page load, read the values for the user and position the div
>
> HTH,
> Eric (the other Eric, confusing)
>
>
>
> On 10/22/06, Eric <[EMAIL PROTECTED]> wrote:
> >
> >
> > Hi,
> >
> > I am just learing Cake. I follow the instruction from the Tuto. to use
> > ajax to drag a element. But How Can I just save the postion after
> > draged baseon the user_ID.
> >
> >
> > Thanks
> >
> >
> > >
> >
>
> ------=_Part_127324_8450777.1161512368640
> Content-Type: text/html; charset=ISO-8859-1
> X-Google-AttachSize: 1026
>
> <div>1) Create a table with id,user_id,positionx,positiony</div>
> <div>2) Create a model for that table</div>
> <div>3) In yourAJAX library, see if there's a callback function like afterDrag() that you can call to sendthe x and y values with an ajax request</div>
> <div>4) In the controller, store the values</div>
> <div>5) On page load, read the values forthe user and position the div</div>
> <div></div>
> <div>HTH,</div>
> <div>Eric (the other Eric, confusing)</div>
> <div><br><br></div>
> <div><span class="gmail_quote">On 10/22/06, <b class="gmail_sendername">Eric</b> <<a href="" [EMAIL PROTECTED]">[EMAIL PROTECTED]</a>> wrote:</span>
> <blockquote class="gmail_quote" style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid"><br>Hi,<br><br>I am just learing Cake. I follow the instruction from the Tuto.to use<br>ajax to drag a element. But How Can I just save the postion after
> <br>draged baseon the user_ID.<br><br><br>Thanks<br><br><br><br>
>
> ------=_Part_127324_8450777.1161512368640--
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Cake PHP" 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/cake-php
-~----------~----~----~----~------~----~------~--~---
- Re: How to Save a Div's position into a database? Eric C Blount
