hi,
I just follow the instrction to do the "to-do list" ajax function. I
got everythin copy and pasted.
When I click the Add button there is an error message
To do
Notice: Undefined variable: javascript in
W:\www\blog\cake\libs\view\templates\layouts\default.thtml on line 36
Fatal error: Call to a member function link() on a non-object in
W:\www\blog\cake\libs\view\templates\layouts\default.thtml on line 36
Done
TestDelete
dddDelete
When I press F5 to refesh the whole page. It works!.... I can just
click to "to-do" or "done". But when I click the delete function, the
same error message comes again.
I just copy the following code and insert between <head> in to my
default.thtml in the location of cake/libs/views/templates/layouts/.
<?php print $html->charsetTag('UTF-8') ?>
<?php print $javascript->link('prototype') ?>
<?php print $javascript->link('scriptaculous.js?load=effects') ?> "
Can you help me figure out how is happen ?
Thanks
Eric C Blount wrote:
> That sounds like a likely candidate.
>
> I'd bet this tutorial will be helpful:
> http://wiki.cakephp.org/tutorials:ajax_sortable_list
>
> And in the controller, use the model functions:
> http://manual.cakephp.org/chapter/models
>
> 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="mailto:[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--
> >
> >
> > >
> >
>
> ------=_Part_131908_24271256.1161557538340
> Content-Type: text/html; charset=ISO-8859-1
> X-Google-AttachSize: 4205
>
> <div>That sounds like a likely candidate.</div>
> <div> </div>
> <div>I'd bet this tutorial will be helpful:</div>
> <div><a
> href="http://wiki.cakephp.org/tutorials:ajax_sortable_list">http://wiki.cakephp.org/tutorials:ajax_sortable_list</a></div>
> <div> </div>
> <div>And in the controller, use the model functions:</div>
> <div><a
> href="http://manual.cakephp.org/chapter/models">http://manual.cakephp.org/chapter/models</a></div>
> <div> </div>
> <div>Use $this->YourModel->findByUser_id($user_id) to try to get a
> result.</div>
> <div>If you get one, save the new values with
> $this->YourModel->save($newValues).</div>
> <div>If not, call $this->YourModel->create() before the save().</div>
> <div> </div>
> <div>Have Fun!</div>
> <div>Eric<br><br> </div>
> <div><span class="gmail_quote">On 10/22/06, <b
> class="gmail_sendername">Eric</b> <<a href="mailto:[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>Thanks Eric...hehe
> (another Eirc)<br><br>The cakephp AJAX library (prototype , <a
> href="http://script.aculo.us">
> script.aculo.us</a>) seems just have<br>endDrag() ,which is "caught by
> the window's mouseup, stops dragging<br>the activeDraggable, if any, via its
> endDrag function. "<br><br>Is it the function?<br><br>More appreciate if
> you can post some code for the controller
> <br><br>Thanks.<br><br><br><br>Eric C Blount wrote:<br>> 1) Create a table
> with id,user_id,positionx,positiony<br>> 2) Create a model for that
> table<br>> 3) In your AJAX library, see if there's a callback function
> like afterDrag()
> <br>> that you can call to send the x and y values with an ajax
> request<br>> 4) In the controller, store the values<br>> 5) On page
> load, read the values for the user and position the div<br>><br>>
> HTH,<br>
> > Eric (the other Eric, confusing)<br>><br>><br>><br>> On
> 10/22/06, Eric <<a href="mailto:[EMAIL PROTECTED]">[EMAIL
> PROTECTED]</a>> wrote:<br>> ><br>> ><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>> ><br>><br>>
> ------=_Part_127324_8450777.1161512368640<br>> Content-Type: text/html;
> charset=ISO-8859-1<br>> X-Google-AttachSize: 1026
> <br>><br>> <div>1) Create a table with
> id,user_id,positionx,positiony</div><br>> <div>2) Create a
> model for that table</div><br>> <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>
> <br>> <div>4) In the controller, store the
> values</div><br>> <div>5) On page load, read the values forthe
> user and position the div</div><br>> <div></div><br>>
> <div>HTH,</div>
> <br>> <div>Eric (the other Eric, confusing)</div><br>>
> <div><br><br></div><br>> <div><span
> class="gmail_quote">On 10/22/06, <b
> class="gmail_sendername">Eric</b> <<a
> href="mailto:
> <a href="mailto:[EMAIL PROTECTED]">[EMAIL PROTECTED]</a>"><a
> href="mailto:[EMAIL PROTECTED]">[EMAIL PROTECTED]</a></a>>
> wrote:</span><br>> <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 <a href="http://Tuto.to">Tuto.to</a>
> use<br>ajax to drag a element. But How Can I just save the postion after
> <br>> <br>draged baseon the
> user_ID.<br><br><br>Thanks<br><br><br><br><br>><br>>
> ------=_Part_127324_8450777.1161512368640--<br><br><br>
> ------=_Part_131908_24271256.1161557538340--
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---