I want the youtube fetch videos have Next/Prev pagination button.
Thanks
It appears that you aren't sending the page token on to the actual API request ... you pass it from one of your pages to another, but then neglect to add it to your listSearch object. Try adding this as an item in the array passed as an argument to the listSearch:
'pageToken' => $_GET['ptk']
Related
I want to get a company page feed URL with a sorting parameter. Right now we can sort the page feed from UI. But I want to generate a URL with sorting applied by default. Check the screenshot below
Can anyone help me how to change the url displayed in the address bar in grails.
Here I have a data table. Once i click on the pagination list displayed at the bottom, lets say 2, then the url changes to
http://localhost:8080/test/account/list?searchText=%25&paginationNumber=10&advancedSearchText=&searchCriteria=&searchOperator=&offset=10&max=10
from
http://localhost:8080/test/account/list
Now I need the same url
http://localhost:8080/test/account/list
even i navigate to different pages.
Whether it is possible to override the url in grails.
It looks like your original page was the result of a form POST, with these additional parameters as fields on the form. When you use <g:paginate> it generates a normal <a> link for each button, which means a GET request, so the params go into the URL.
You might be able to get it to do what you want with a bit of JavaScript, wrapping a POST form around the paginate buttons with hidden fields for the additional data, and attach an event handler to the pagination links to trigger a submit of the form.
Alternatively, store the extra parameters server side in the session instead of passing them back and forth, and accept the offset and max in the URL.
I'm trying to use will paginate with ajax, but I don't show the will_paginate buttons... instead I use a see more button, that makes an Ajax request and append the results to the page.
what I'm trying to do is disable this see more button if I hit the last page of records!!
Any idea how to know that the current page is the last page??
#collection.total_pages == #collection.current_page
Accessing the #collection.total_pages method will give you the total number of pages currently being returned. You can use this to evaluate against your active page using the #collection.current_page method. This is still applicable if you're reloading your collection on each expansion.
The implementation will be to use the AJAX call to replace the HTML content if this evaluation is true.
You can use next_page condition
#collection.next_page.present?
Currently,I'm currently using Koala 1.4.0 to do open graph.
I did create an
action types : View
Object types : Advertisement
What I'm currently wish to archieve is :
When Click the View button on the page, on the facebook ticker,it will show ,a user is viewing a advertisement.
Error i get:
HTTP 500: Response body: {"error":{"type":"Exception","message":"The action you're trying to publish is invalid because it does not specify any reference objects. At least one of the following properties must be specified: advertisement."}}
How I trying to do it:
graph = Koala::Facebook::API.new(#user.token)
graph.put_connections("#{#user.uid}", "namespace:View" , :object=>"#{url_for(#advertisement)}"
It is in my show controller. And in my show.html.erb , i did included all the meta data . I did a share to Facebook function using koala also,its work well and successffully get the meta data from my page and post it on Facebook.
Using rails 3.0.9.
I'm not familiar with Koala, but it seems like you should be using ':advertisement' in place of ':object' in your graph.put_connections call. Example:
graph.put_connections("#{#user.uid}", "namespace:View" , :advertisement=>"#{url_for(#advertisement)}"
This worked for me:
#graph.put_connections("me", "namespace:action", :object => object_url)
This is the usual thing: you have a list of items with several attributes. You can :
sort the list according to each of the attributes, in both ascending and descending order
filter (search) the items, again on all attributes
navigate between different pages of results
All of this gives you differents parameters for a given page:
sorting attribute and sorting order
pairs of attribute name and values for the filtering
page number
How do you handle the propagation of all these paramters between your pages ? Let's say you can edit one item, and when you go back, you'd like to get on the same page you where.
Do you simply put all parameters in the url (and pass them as "return parameters" to the edit page) ? Do you put some in the session (maybe sort and filter parameters) ?
I like to make them part of the URL so that if someone bookmarks the page or emails a link to the page, it will render the page exactly the same way. You can't do that if you depend on session state.