get Items per page dynamically, Alfresco 5,2

cancel
Showing results for 
Search instead for 
Did you mean: 
youbfresco
Active Member

get Items per page dynamically, Alfresco 5,2

Hii every Alfresco-man !!!

I want to add number of items in page dynamically in my alfresco share 5.2 .

for example show items in page  by 10 or 30 or 40

for the static way the line : model.widgets[1].options.pageSize , but dynamic way i don't get how to do that

could you help me please

7 Replies
youbfresco
Active Member

Re: get Items per page dynamically, Alfresco 5,2

No response Smiley Sad Smiley Sad  !!!

sanjaybandhniya
Intermediate

Re: get Items per page dynamically, Alfresco 5,2

At which place you want to apply this functionality and up to now what you have tried?

youbfresco
Active Member

Re: get Items per page dynamically, Alfresco 5,2

Hii Sanjay ,

thks for your response ; I want to apply it on the documentlibrary.

I hope this is the answer you want

youbfresco
Active Member

Re: get Items per page dynamically, Alfresco 5,2

I tried :

model.widgets[i].options.pageSize = [10, 20,30];

but it doesn't work

sanjaybandhniya
Intermediate

Re: get Items per page dynamically, Alfresco 5,2

Hi,

To get row per page dynamically,First of you have to configure dropdown in documentlibrary toolbar.

site-webscripts\org\alfresco\components\documentlibrary\include\documentlist_v2.lib.ftl

Put below code inside above file at proper place.

Ex.

<div>
   <span id="${id}-rowPerPage-button" class="yui-button yui-push-button">
      <span class="first-child">
         <button>Row Per Page</button>
      </span>
   </span>
<select id="${id}-rowPerPage">
      <option>10</option>
      <option>20</option>
</select>
</div>

components\documentlibrary\documentlist.js

After that configure that select inside above file.

Ex.

if (Dom.get(this.id + "-rowPerPage"))
{
      this.widgets.rowPerPage = Alfresco.util.createYUIButton(this, "rowPerPage-button", this.changePage, {
      type: "menu",
      menu: "rowPerPage"
   });
   if (this.widgets.rowPerPage !== null)
   {
      this.dynamicControls.push(this.widgets.rowPerPage);
   }
}

You can take reference of sorting menu/documentlibrary view menu.

Some how you have to get selected option from rowPerPage and you need to set in this.options.pageSize.

I have not tried this scenario but you can set this way try.

If you succeed then please post your step/code so it will be helpful to others.

Thanks,

Contcentric

youbfresco
Active Member

Re: get Items per page dynamically, Alfresco 5,2

HELOOO! 

Finally I can show my button and dropdown list , thks a lot. But I dont understand how can i link it with pageSize.

have you i link for sorting documentlibrary  to take it as an example  ?

thks a lot 

shivam1sharma
Member II

Re: get Items per page dynamically, Alfresco 5,2

Hi,

Did you got any solution , how to implement this because I need to implement this functionality.

Thanks in advance.