Hi Jeremy,

I am still not using Ajax, but I do think that information on my
search solution may be usefull to you.

When a user submits a search, I save the search criteria in the
database, thus getting a unique ID for the search and for the result,
which is then related to the search ID.

The search ID is then stored in the session as the current search.

So whenever I invoke the search method, I do the following:
If no new data is submitted, then use the existing search ID.
Else make a new search ID.

So when I go to another page in the result, I will use the existing
search ID in my pagination, thus giving a normal pagination of the
result to the user.

I then assume that the above or something similar is what you have to
make! How about it?
Enjoy,
   John


On Mar 18, 6:54 pm, Jeremy Burns <jeremybu...@me.com> wrote:
> I'm not terribly strong on Ajax or Javascript, so this might be
> obvious to some of you.
>
> I have a view with a form that, when submitted, triggers a find and
> returns some search results to the same view. The search criteria is
> shown in the original search form fields.
>
> The view also contains an element that displays the search results (if
> any). The element contains a table that is using ajax pagination (I'm
> using Cake version 1.3 with the new JSHelper and JQuery).
>
> My first problem is: the ajax is triggering OK, but it is going back
> to the same controller function that fires the search. As there is no
> form data, the search triggers again but - with no form data and
> therefore no search criteria - it returns an empty array (i.e. no
> search results). Therefore the pagination is empty. How do I prevent
> this happening? I just want to get the same results back either sorted
> or on a different page.
>
> My second problem is: when I click a pagination link [firstly I get
> problem 1 above!] the div that holds the element now contains all of
> the page code (headers and everything). All I want is the bare
> contents of the element. How do I achieve this please?
>
> As an added bonus, I'd like the search criteria form to be Ajax as
> well, so that it just refreshes my results element.
>
> Thanks.

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en

Reply via email to