Fórum

Search container pagination with AJAX effect

Suyash Bhalekar, modificado 11 Anos atrás.

Search container pagination with AJAX effect

New Member Postagens: 24 Data de Entrada: 04/09/12 Postagens Recentes
I want that liferay-ui:search-paginator should work with ajax.

I want it to have the same UI as that of say "User & Organizations" search in control panel or anyother portlet like say displaying list of "Sites"
but this should be ajaxed, like if I click on a page number only my portlet should get refreshed with the contents..

Now I have achieved this with

var searchEntities = A.one('#<portlet:namespace />searchEntities');

if (searchEntities) {
var parent = searchEntities.get('parentNode');

parent.plug(
A.Plugin.IO,
{
autoLoad: false
}
);


searchEntities.all('a').on(
'click',
function(event) {
var uri = event.currentTarget.get('href').replace(/p_p_state=normal/i, 'p_p_state=exclusive');

parent.io.set('uri', uri);
parent.io.start();

event.preventDefault();
}
);
}
});

where searchEntities is the div ID conataining all the links for paginator.

Now with page refresh I am not able to retrieve the state of paginator. However I have created a static variable which keeps track of page no
and I am able to retrieve it on page refresh also. Only Issue I am facing now is that though it shows correct paginator i.e the paginator no before refresh
but the contents retrieve are of first page only (first paginator)

Kinldy reply ASAP.
Đỗ Nguyên Thạnh, modificado 11 Anos atrás.

RE: Search container pagination with AJAX effect

New Member Postagens: 4 Data de Entrada: 24/08/12 Postagens Recentes
hi Suyash Bhalekar,

I have a problem like you and I have solved it by using your example
here is my code:

//is the div ID conataining all the links for paginator
var searchEntities = A.one('.taglib-page-iterator');

if (searchEntities) {
var parent = A.one('#listThayDoiKhaiSinhContainer');

parent.plug(
A.Plugin.IO,
{
autoLoad: false
}
);


searchEntities.all('a').on('click',function(event) {
var uri = event.currentTarget.get('href').replace(/p_p_state=normal/i, 'p_p_state=exclusive');

parent.io.set('uri', uri);
parent.io.start();

event.preventDefault();
});
}

thanks,
thanhdn
Harsh Kanakhara, modificado 7 Anos atrás.

RE: Search container pagination with AJAX effect

New Member Postagens: 14 Data de Entrada: 29/01/16 Postagens Recentes
Can you be please more specific what this #listThayDoiKhaiSinhContainer stands for ?