Jump to content
  • 0

Disable Ajax from Pagination


Blesta Addons

Question

i want to disable the ajax class from herf links in the pagination, but it appear is not taking effect even if, i have added the new class to the pagination parametre but is affecting the class

				'navigation' => array(
					// All numeric links
					'numerical' => [
						'link_attributes' => ['class' => 'none']
					]
				)

i want to disable the ajax call from the pagination links (admin side). how to do this ?

Link to comment
Share on other sites

6 answers to this question

Recommended Posts

  • 0
1 hour ago, Tyson said:

What you have would work to disable AJAX for numerical pagination links, but not the current page, first, last, previous, or next links. I assume you updated the Blesta.pagination_ajax config file values for this?

i have tried all, but nothing work, can you test override the pagination class and links class, i begin to feel is a bug .

Link to comment
Share on other sites

  • 0

I tested updating the Blesta.pagination_ajax config value to remove the ajax class (i.e. changed from 'class' => "ajax" to 'class' => ""), and observed the Invoices widget on a client profile to no longer load via ajax when clicking any of the pagination links. Do you not encounter this behavior? I'm using v4.1.

Link to comment
Share on other sites

  • 0
3 hours ago, Tyson said:

I tested updating the Blesta.pagination_ajax config value to remove the ajax class (i.e. changed from 'class' => "ajax" to 'class' => ""), and observed the Invoices widget on a client profile to no longer load via ajax when clicking any of the pagination links. Do you not encounter this behavior? I'm using v4.1.

i'm using v4.1 too, and i tried to change the pagination attributes but no result, i'm using the pagination in the admin_manage_plugin.php file . can you post your array merge . i think you are testing in the client side .

Link to comment
Share on other sites

  • 0

So you're using it in a plugin? Most plugins make a call to AppController::setPagination($get, $settings, $ajax) to load and set the pagination from the config. The Blesta.pagination_ajax value in the config is used when the third argument, $ajax, is true. This value does not get overridden.

If you want to override the AJAX pagination behavior, don't call AppController::setPagination. Instead, load and set the pagination yourself.

// Load pagination
$this->Pagination = $this->getFromContainer('pagination');

// Set GET params
$this->Pagination->setGet($this->get);

// Your pagination settings merged with your custom pagination settings
$this->Pagination->setSettings(Configure::get('Blesta.pagination'));

// Make Pagination available to the view
$this->view->Pagination = $this->Pagination;

 

Link to comment
Share on other sites

  • 0
On 29/08/2017 at 5:42 PM, Tyson said:

So you're using it in a plugin? Most plugins make a call to AppController::setPagination($get, $settings, $ajax) to load and set the pagination from the config. The Blesta.pagination_ajax value in the config is used when the third argument, $ajax, is true. This value does not get overridden.

If you want to override the AJAX pagination behavior, don't call AppController::setPagination. Instead, load and set the pagination yourself.


// Load pagination
$this->Pagination = $this->getFromContainer('pagination');

// Set GET params
$this->Pagination->setGet($this->get);

// Your pagination settings merged with your custom pagination settings
$this->Pagination->setSettings(Configure::get('Blesta.pagination'));

// Make Pagination available to the view
$this->view->Pagination = $this->Pagination;

 

Thanks i will try your solution this weekend.

also i noticed that the $this->renderAjaxWidgetIfAsync() is not working in the admin_manage_plugin . i can see the ajax loading new data as expected, but the loaded data in not inserted in the content div! how we can make it working ?

 

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
Answer this question...

×   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...