留言板

Search container pagination with AJAX effect

Suyash Bhalekar,修改在11 年前。

Search container pagination with AJAX effect

New Member 帖子: 24 加入日期: 12-9-4 最近的帖子
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,修改在11 年前。

RE: Search container pagination with AJAX effect

New Member 帖子: 4 加入日期: 12-8-24 最近的帖子
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,修改在7 年前。

RE: Search container pagination with AJAX effect

New Member 帖子: 14 加入日期: 16-1-29 最近的帖子
Can you be please more specific what this #listThayDoiKhaiSinhContainer stands for ?