Jump to content

Pagination In Client Side


activa

Recommended Posts

is using the pagination helper depend in other helper/model ?

 

i have set up it in my plugin , the page show the real item should be displayed , when i navigate manually to the next page it should the next items , so the pagination is working , but is not showing the navigation links in client side .

 

not in client template i'm not using the WidgetClient  to render the page .

 

i use the fallowing line in the pdt file

$this->Pagination->build();
Link to comment
Share on other sites

is using the pagination helper depend in other helper/model ?

Pagination requires the HTML helper.

 

 

i have set up it in my plugin , the page show the real item should be displayed , when i navigate manually to the next page it should the next items , so the pagination is working , but is not showing the navigation links in client side .

 

not in client template i'm not using the WidgetClient  to render the page .

 

i use the fallowing line in the pdt file

$this->Pagination->build();

 

Calling the build method only builds pagination if you had previously set data into it from which pagination could be built, for example, the number of total results and the page you're currently on. Also, by default, pagination doesn't show if there is only one page of results. You should check the settings you have configured for pagination.

Link to comment
Share on other sites

i get contacted by active or this subject . and i hev his code, and i see it well done

 

the code in the controller

// Overwrite default pagination settings
  $settings = array_merge(Configure::get("Blesta.pagination_client"), array(
    'total_results' => $total_results,
    'uri'=> $this->base_uri . "plugin/tarata/main/index/[p]/" ,
    'params'=>array('sort'=>'id','order'=>'DESC')
   )
  );
  $this->helpers(array("Pagination"=>array($this->get, $settings)));
  $this->Pagination->setSettings(Configure::get("Blesta.pagination_ajax"));

in the template file the pagination build is well set .

 

the pagination is working in page (page 1/ page2 ) ...

 

the probleme the pagination is not displaying in the client view . normally if there are more than 1 page in result  it should be displayed .

 

i have made a simple test ;

 

the total result is 6 , the displayed item per page is 4 .

 

the page display 4 item but no pagination displayed, when i go to page 2 i see 2 result .also no pagination displayed 

Link to comment
Share on other sites

EDIT i got it working .

 

the pagination has a option results_per_page , by default it 20 , adding this setting to the config array , fixed the issue .

// Overwrite default pagination settings
  $settings = array_merge(Configure::get("Blesta.pagination_client"), array(
    'total_results' => $total_results,
    'uri'=> $this->base_uri . "plugin/tarata/main/index/[p]/" ,
    'results_per_page'=> 4 ,
    'params'=>array('sort'=>'id','order'=>'DESC')
   )
  );
Link to comment
Share on other sites

 

EDIT i got it working .

 

the pagination has a option results_per_page , by default it 20 , adding this setting to the config array , fixed the issue .

// Overwrite default pagination settings
  $settings = array_merge(Configure::get("Blesta.pagination_client"), array(
    'total_results' => $total_results,
    'uri'=> $this->base_uri . "plugin/tarata/main/index/[p]/" ,
    'results_per_page'=> 4 ,
    'params'=>array('sort'=>'id','order'=>'DESC')
   )
  );

 

Thanks for your help .

Link to comment
Share on other sites

Good to hear you got it working.

 

The default number of results shown per page is set in the config file at 20. You can override it on a specific page by setting a new value for pagination (as you did). However, if you intend to use the default value from the config file you may want to debug why the pagination is not showing in the client UI. It should function exactly as, say, the Transactions widget's pagination. The fact it didn't appear is strange, but all of the code you shared looks fine to me, so it may be an issue caused somewhere else.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...