Problem paginator views/ajax

Created on 24 July 2022, over 2 years ago
Updated 16 June 2023, over 1 year ago

Problem/Motivation

I use the following code for task in block view

$.ajax({
url: Drupal.settings.basePath + 'views/ajax',
type: 'post',
data: {
view_name: 'views_date',
view_display_id: 'block_1',
},
dataType: 'json',
success: function (response) {
if (response[3] !== undefined) {
var viewHtml = response[3].data;
$('#question-container').append(viewHtml);
Drupal.attachBehaviors();
}
}
});

If the code brings the view block as planned, it works fine, but there is a problem with the pager, since it does not work or works badly, and pagination does not work with ajax

Steps to reproduce
1- Create views block with names for example:
- view_name: 'views_date',
- view_display_id: 'block_1',
2- Use script in you theme
3- Create a block or add a div in the node in the body field the attribute in this case is "#question-container" at the end it should look like this

4- Add a couple of contents to be able to filter them in the view
5- Try pager

πŸ’¬ Support request
Status

Closed: outdated

Version

9.5

Component
AjaxΒ  β†’

Last updated 1 day ago

Created by

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024