Magento 2 : Admin Grid Pagination Issue Planned maintenance scheduled April 23, 2019 at 23:30 UTC (7:30 pm US/Eastern) Announcing the arrival of Valued Associate #679: Cesar Manara Unicorn Meta Zoo #1: Why another podcast?Magento(1.9) pagination issueuiComponent Form. How to show data from DB tableChanging paging options in admin gridgrid admin limit paginationMagento 2.1 Create a filter in the product grid by new attributeMagento 2 Add new field to Magento_User admin formMagento 1.9 Pagination IssueMagento 2 UI grid non db dataprovider and pagination issueMagento 1.9 custom collection pagination not working in admin grid?Magento 2: form & grid components on one page
TV series episode where humans nuke aliens before decrypting their message that states they come in peace
What was Apollo 13's "Little Jolt" after MECO?
Did war bonds have better investment alternatives during WWII?
What *exactly* is electrical current, voltage, and resistance?
Processing ADC conversion result: DMA vs Processor Registers
Is a self contained air-bullet cartridge feasible?
`FindRoot [ ]`::jsing: Encountered a singular Jacobian at a point...WHY
What is the numbering system used for the DSN dishes?
What to do with someone that cheated their way though university and a PhD program?
Is Bran literally the world's memory?
Why doesn't the university give past final exams' answers?
What is ls Largest Number Formed by only moving two sticks in 508?
Israeli soda type drink
Determinant of a matrix with 2 equal rows
Co-worker works way more than he should
What is the purpose of the side handle on a hand ("eggbeater") drill?
Why I cannot instantiate a class whose constructor is private in a friend class?
How would you suggest I follow up with coworkers about our deadline that's today?
Is there a possibility to generate a list dynamically in Latex?
What is a 'Key' in computer science?
Putting Ant-Man on house arrest
Does using the Inspiration rules for character defects encourage My Guy Syndrome?
Marquee sign letters
Arriving in Atlanta (after US Preclearance in Dublin). Will I go through TSA security in Atlanta to transfer to a connecting flight?
Magento 2 : Admin Grid Pagination Issue
Planned maintenance scheduled April 23, 2019 at 23:30 UTC (7:30 pm US/Eastern)
Announcing the arrival of Valued Associate #679: Cesar Manara
Unicorn Meta Zoo #1: Why another podcast?Magento(1.9) pagination issueuiComponent Form. How to show data from DB tableChanging paging options in admin gridgrid admin limit paginationMagento 2.1 Create a filter in the product grid by new attributeMagento 2 Add new field to Magento_User admin formMagento 1.9 Pagination IssueMagento 2 UI grid non db dataprovider and pagination issueMagento 1.9 custom collection pagination not working in admin grid?Magento 2: form & grid components on one page
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;
In magento admin, custom grid pagination is not working. I have 3 records in database, When I enter 2 records/page then next page button remains disabled and it will not show remaining 1 record.
This is Default setting when page is loaded.
This is the actual issue.
As soon as i type 2 and press enter it shows correct values until the grid is loading as in below image.But when grid loaded it will not show remaining record.
Below is the code of grid xml before columns
<listing xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Ui:etc/ui_configuration.xsd">
<argument name="data" xsi:type="array">
<item name="js_config" xsi:type="array">
<item name="provider" xsi:type="string">productattachments_listing.productattachments_listing_data_source</item>
<item name="deps" xsi:type="string">productattachments_listing.productattachments_listing_data_source</item>
</item>
<item name="spinner" xsi:type="string">productattachments_columns</item>
<item name="buttons" xsi:type="array">
<item name="add" xsi:type="array">
<item name="name" xsi:type="string">add</item>
<item name="label" xsi:type="string" translate="true">Add New File</item>
<item name="class" xsi:type="string">primary</item>
<item name="url" xsi:type="string">*/*/new</item>
</item>
</item>
</argument>
<dataSource name="productattachments_listing_data_source">
<argument name="dataProvider" xsi:type="configurableObject">
<argument name="class" xsi:type="string">ProductattachmentsGridDataProvider</argument>
<argument name="name" xsi:type="string">productattachments_listing_data_source</argument>
<argument name="primaryFieldName" xsi:type="string">productattachments_id</argument>
<argument name="requestFieldName" xsi:type="string">id</argument>
<argument name="data" xsi:type="array">
<item name="config" xsi:type="array">
<item name="update_url" xsi:type="url" path="mui/index/render"/>
</item>
</argument>
</argument>
<argument name="data" xsi:type="array">
<item name="js_config" xsi:type="array">
<item name="component" xsi:type="string">Magento_Ui/js/grid/provider</item>
</item>
</argument>
</dataSource>
<container name="listing_top">
<argument name="data" xsi:type="array">
<item name="config" xsi:type="array">
<item name="template" xsi:type="string">ui/grid/toolbar</item>
<item name="stickyTmpl" xsi:type="string">ui/grid/sticky/toolbar</item>
</item>
</argument>
<bookmark name="bookmarks">
<argument name="data" xsi:type="array">
<item name="config" xsi:type="array">
<item name="storageConfig" xsi:type="array">
<item name="namespace" xsi:type="string">productattachments_listing</item>
</item>
</item>
</argument>
</bookmark>
<component name="columns_controls">
<argument name="data" xsi:type="array">
<item name="config" xsi:type="array">
<item name="columnsData" xsi:type="array">
<item name="provider" xsi:type="string">productattachments_listing.productattachments_listing.productattachments_columns</item>
</item>
<item name="component" xsi:type="string">Magento_Ui/js/grid/controls/columns</item>
<item name="displayArea" xsi:type="string">dataGridActions</item>
</item>
</argument>
</component>
<filters name="listing_filters">
<argument name="data" xsi:type="array">
<item name="config" xsi:type="array">
<item name="columnsProvider" xsi:type="string">productattachments_listing.productattachments_listing.productattachments_columns</item>
<item name="storageConfig" xsi:type="array">
<item name="provider" xsi:type="string">productattachments_listing.productattachments_listing.listing_top.bookmarks</item>
<item name="namespace" xsi:type="string">current.filters</item>
</item>
<item name="templates" xsi:type="array">
<item name="filters" xsi:type="array">
<item name="select" xsi:type="array">
<item name="component" xsi:type="string">Magento_Ui/js/form/element/ui-select</item>
<item name="template" xsi:type="string">ui/grid/filters/elements/ui-select</item>
</item>
</item>
</item>
<item name="childDefaults" xsi:type="array">
<item name="provider" xsi:type="string">productattachments_listing.productattachments_listing.listing_top.listing_filters</item>
<item name="imports" xsi:type="array">
<item name="visible" xsi:type="string">productattachments_listing.productattachments_listing.productattachments_columns.$ $.index :visible</item>
</item>
</item>
</item>
<item name="observers" xsi:type="array">
<item name="column" xsi:type="string">column</item>
</item>
</argument>
<filterSelect name="store_id">
<argument name="optionsProvider" xsi:type="configurableObject">
<argument name="class" xsi:type="string">MagentoCmsUiComponentListingColumnCmsOptions</argument>
</argument>
<argument name="data" xsi:type="array">
<item name="config" xsi:type="array">
<item name="dataScope" xsi:type="string">store_id</item>
<item name="label" xsi:type="string" translate="true">Store View</item>
<item name="captionValue" xsi:type="string">0</item>
</item>
</argument>
</filterSelect>
</filters>
<massaction name="listing_massaction">
<argument name="data" xsi:type="array">
<item name="config" xsi:type="array">
<item name="selectProvider" xsi:type="string">productattachments_listing.productattachments_listing.productattachments_columns.ids</item>
<item name="indexField" xsi:type="string">productattachments_id</item>
</item>
</argument>
<action name="delete">
<argument name="data" xsi:type="array">
<item name="config" xsi:type="array">
<item name="type" xsi:type="string">delete</item>
<item name="label" xsi:type="string" translate="true">Delete</item>
<item name="url" xsi:type="url" path="productattachmentsadmin/productattachments/massDelete"/>
<item name="confirm" xsi:type="array">
<item name="title" xsi:type="string" translate="true">Delete items</item>
<item name="message" xsi:type="string" translate="true">Are you sure you wan't to delete selected items?</item>
</item>
</item>
</argument>
</action>
<action name="disable">
<argument name="data" xsi:type="array">
<item name="config" xsi:type="array">
<item name="type" xsi:type="string">disable</item>
<item name="label" xsi:type="string" translate="true">Disable</item>
<item name="url" xsi:type="url" path="productattachmentsadmin/productattachments/massDisable"/>
</item>
</argument>
</action>
<action name="enable">
<argument name="data" xsi:type="array">
<item name="config" xsi:type="array">
<item name="type" xsi:type="string">enable</item>
<item name="label" xsi:type="string" translate="true">Enable</item>
<item name="url" xsi:type="url" path="productattachmentsadmin/productattachments/massEnable"/>
</item>
</argument>
</action>
<action name="edit">
<argument name="data" xsi:type="array">
<item name="config" xsi:type="array">
<item name="type" xsi:type="string">edit</item>
<item name="label" xsi:type="string" translate="true">Edit</item>
<item name="callback" xsi:type="array">
<item name="provider" xsi:type="string">productattachments_listing.productattachments_listing.productattachments_columns_editor</item>
<item name="target" xsi:type="string">editSelected</item>
</item>
</item>
</argument>
</action>
</massaction>
<paging name="listing_paging">
<argument name="data" xsi:type="array">
<item name="config" xsi:type="array">
<item name="storageConfig" xsi:type="array">
<item name="provider" xsi:type="string">productattachments_listing.productattachments_listing.listing_top.bookmarks</item>
<item name="namespace" xsi:type="string">current.paging</item>
</item>
<item name="selectProvider" xsi:type="string">productattachments_listing.productattachments_listing.productattachments_columns.ids</item>
</item>
</argument>
</paging>
</container>
magento2 admin grid uicomponent pagination
add a comment |
In magento admin, custom grid pagination is not working. I have 3 records in database, When I enter 2 records/page then next page button remains disabled and it will not show remaining 1 record.
This is Default setting when page is loaded.
This is the actual issue.
As soon as i type 2 and press enter it shows correct values until the grid is loading as in below image.But when grid loaded it will not show remaining record.
Below is the code of grid xml before columns
<listing xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Ui:etc/ui_configuration.xsd">
<argument name="data" xsi:type="array">
<item name="js_config" xsi:type="array">
<item name="provider" xsi:type="string">productattachments_listing.productattachments_listing_data_source</item>
<item name="deps" xsi:type="string">productattachments_listing.productattachments_listing_data_source</item>
</item>
<item name="spinner" xsi:type="string">productattachments_columns</item>
<item name="buttons" xsi:type="array">
<item name="add" xsi:type="array">
<item name="name" xsi:type="string">add</item>
<item name="label" xsi:type="string" translate="true">Add New File</item>
<item name="class" xsi:type="string">primary</item>
<item name="url" xsi:type="string">*/*/new</item>
</item>
</item>
</argument>
<dataSource name="productattachments_listing_data_source">
<argument name="dataProvider" xsi:type="configurableObject">
<argument name="class" xsi:type="string">ProductattachmentsGridDataProvider</argument>
<argument name="name" xsi:type="string">productattachments_listing_data_source</argument>
<argument name="primaryFieldName" xsi:type="string">productattachments_id</argument>
<argument name="requestFieldName" xsi:type="string">id</argument>
<argument name="data" xsi:type="array">
<item name="config" xsi:type="array">
<item name="update_url" xsi:type="url" path="mui/index/render"/>
</item>
</argument>
</argument>
<argument name="data" xsi:type="array">
<item name="js_config" xsi:type="array">
<item name="component" xsi:type="string">Magento_Ui/js/grid/provider</item>
</item>
</argument>
</dataSource>
<container name="listing_top">
<argument name="data" xsi:type="array">
<item name="config" xsi:type="array">
<item name="template" xsi:type="string">ui/grid/toolbar</item>
<item name="stickyTmpl" xsi:type="string">ui/grid/sticky/toolbar</item>
</item>
</argument>
<bookmark name="bookmarks">
<argument name="data" xsi:type="array">
<item name="config" xsi:type="array">
<item name="storageConfig" xsi:type="array">
<item name="namespace" xsi:type="string">productattachments_listing</item>
</item>
</item>
</argument>
</bookmark>
<component name="columns_controls">
<argument name="data" xsi:type="array">
<item name="config" xsi:type="array">
<item name="columnsData" xsi:type="array">
<item name="provider" xsi:type="string">productattachments_listing.productattachments_listing.productattachments_columns</item>
</item>
<item name="component" xsi:type="string">Magento_Ui/js/grid/controls/columns</item>
<item name="displayArea" xsi:type="string">dataGridActions</item>
</item>
</argument>
</component>
<filters name="listing_filters">
<argument name="data" xsi:type="array">
<item name="config" xsi:type="array">
<item name="columnsProvider" xsi:type="string">productattachments_listing.productattachments_listing.productattachments_columns</item>
<item name="storageConfig" xsi:type="array">
<item name="provider" xsi:type="string">productattachments_listing.productattachments_listing.listing_top.bookmarks</item>
<item name="namespace" xsi:type="string">current.filters</item>
</item>
<item name="templates" xsi:type="array">
<item name="filters" xsi:type="array">
<item name="select" xsi:type="array">
<item name="component" xsi:type="string">Magento_Ui/js/form/element/ui-select</item>
<item name="template" xsi:type="string">ui/grid/filters/elements/ui-select</item>
</item>
</item>
</item>
<item name="childDefaults" xsi:type="array">
<item name="provider" xsi:type="string">productattachments_listing.productattachments_listing.listing_top.listing_filters</item>
<item name="imports" xsi:type="array">
<item name="visible" xsi:type="string">productattachments_listing.productattachments_listing.productattachments_columns.$ $.index :visible</item>
</item>
</item>
</item>
<item name="observers" xsi:type="array">
<item name="column" xsi:type="string">column</item>
</item>
</argument>
<filterSelect name="store_id">
<argument name="optionsProvider" xsi:type="configurableObject">
<argument name="class" xsi:type="string">MagentoCmsUiComponentListingColumnCmsOptions</argument>
</argument>
<argument name="data" xsi:type="array">
<item name="config" xsi:type="array">
<item name="dataScope" xsi:type="string">store_id</item>
<item name="label" xsi:type="string" translate="true">Store View</item>
<item name="captionValue" xsi:type="string">0</item>
</item>
</argument>
</filterSelect>
</filters>
<massaction name="listing_massaction">
<argument name="data" xsi:type="array">
<item name="config" xsi:type="array">
<item name="selectProvider" xsi:type="string">productattachments_listing.productattachments_listing.productattachments_columns.ids</item>
<item name="indexField" xsi:type="string">productattachments_id</item>
</item>
</argument>
<action name="delete">
<argument name="data" xsi:type="array">
<item name="config" xsi:type="array">
<item name="type" xsi:type="string">delete</item>
<item name="label" xsi:type="string" translate="true">Delete</item>
<item name="url" xsi:type="url" path="productattachmentsadmin/productattachments/massDelete"/>
<item name="confirm" xsi:type="array">
<item name="title" xsi:type="string" translate="true">Delete items</item>
<item name="message" xsi:type="string" translate="true">Are you sure you wan't to delete selected items?</item>
</item>
</item>
</argument>
</action>
<action name="disable">
<argument name="data" xsi:type="array">
<item name="config" xsi:type="array">
<item name="type" xsi:type="string">disable</item>
<item name="label" xsi:type="string" translate="true">Disable</item>
<item name="url" xsi:type="url" path="productattachmentsadmin/productattachments/massDisable"/>
</item>
</argument>
</action>
<action name="enable">
<argument name="data" xsi:type="array">
<item name="config" xsi:type="array">
<item name="type" xsi:type="string">enable</item>
<item name="label" xsi:type="string" translate="true">Enable</item>
<item name="url" xsi:type="url" path="productattachmentsadmin/productattachments/massEnable"/>
</item>
</argument>
</action>
<action name="edit">
<argument name="data" xsi:type="array">
<item name="config" xsi:type="array">
<item name="type" xsi:type="string">edit</item>
<item name="label" xsi:type="string" translate="true">Edit</item>
<item name="callback" xsi:type="array">
<item name="provider" xsi:type="string">productattachments_listing.productattachments_listing.productattachments_columns_editor</item>
<item name="target" xsi:type="string">editSelected</item>
</item>
</item>
</argument>
</action>
</massaction>
<paging name="listing_paging">
<argument name="data" xsi:type="array">
<item name="config" xsi:type="array">
<item name="storageConfig" xsi:type="array">
<item name="provider" xsi:type="string">productattachments_listing.productattachments_listing.listing_top.bookmarks</item>
<item name="namespace" xsi:type="string">current.paging</item>
</item>
<item name="selectProvider" xsi:type="string">productattachments_listing.productattachments_listing.productattachments_columns.ids</item>
</item>
</argument>
</paging>
</container>
magento2 admin grid uicomponent pagination
check the network tab from browser is there any error coming.
– Prasanta Hatui
Feb 23 '17 at 6:13
no error in network tab. i have also checked grid code line by line and cant find any issue.
– Ashar Riaz
Feb 23 '17 at 6:34
there is another issue when i change records/page to previous one then grid is filled with all dublicate values.
– Ashar Riaz
Feb 23 '17 at 6:36
did u added grid collection model?
– Prasanta Hatui
Feb 23 '17 at 6:44
yes i have added grid collection model. I have edit my question and add 3rd screenshot.
– Ashar Riaz
Feb 23 '17 at 6:59
add a comment |
In magento admin, custom grid pagination is not working. I have 3 records in database, When I enter 2 records/page then next page button remains disabled and it will not show remaining 1 record.
This is Default setting when page is loaded.
This is the actual issue.
As soon as i type 2 and press enter it shows correct values until the grid is loading as in below image.But when grid loaded it will not show remaining record.
Below is the code of grid xml before columns
<listing xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Ui:etc/ui_configuration.xsd">
<argument name="data" xsi:type="array">
<item name="js_config" xsi:type="array">
<item name="provider" xsi:type="string">productattachments_listing.productattachments_listing_data_source</item>
<item name="deps" xsi:type="string">productattachments_listing.productattachments_listing_data_source</item>
</item>
<item name="spinner" xsi:type="string">productattachments_columns</item>
<item name="buttons" xsi:type="array">
<item name="add" xsi:type="array">
<item name="name" xsi:type="string">add</item>
<item name="label" xsi:type="string" translate="true">Add New File</item>
<item name="class" xsi:type="string">primary</item>
<item name="url" xsi:type="string">*/*/new</item>
</item>
</item>
</argument>
<dataSource name="productattachments_listing_data_source">
<argument name="dataProvider" xsi:type="configurableObject">
<argument name="class" xsi:type="string">ProductattachmentsGridDataProvider</argument>
<argument name="name" xsi:type="string">productattachments_listing_data_source</argument>
<argument name="primaryFieldName" xsi:type="string">productattachments_id</argument>
<argument name="requestFieldName" xsi:type="string">id</argument>
<argument name="data" xsi:type="array">
<item name="config" xsi:type="array">
<item name="update_url" xsi:type="url" path="mui/index/render"/>
</item>
</argument>
</argument>
<argument name="data" xsi:type="array">
<item name="js_config" xsi:type="array">
<item name="component" xsi:type="string">Magento_Ui/js/grid/provider</item>
</item>
</argument>
</dataSource>
<container name="listing_top">
<argument name="data" xsi:type="array">
<item name="config" xsi:type="array">
<item name="template" xsi:type="string">ui/grid/toolbar</item>
<item name="stickyTmpl" xsi:type="string">ui/grid/sticky/toolbar</item>
</item>
</argument>
<bookmark name="bookmarks">
<argument name="data" xsi:type="array">
<item name="config" xsi:type="array">
<item name="storageConfig" xsi:type="array">
<item name="namespace" xsi:type="string">productattachments_listing</item>
</item>
</item>
</argument>
</bookmark>
<component name="columns_controls">
<argument name="data" xsi:type="array">
<item name="config" xsi:type="array">
<item name="columnsData" xsi:type="array">
<item name="provider" xsi:type="string">productattachments_listing.productattachments_listing.productattachments_columns</item>
</item>
<item name="component" xsi:type="string">Magento_Ui/js/grid/controls/columns</item>
<item name="displayArea" xsi:type="string">dataGridActions</item>
</item>
</argument>
</component>
<filters name="listing_filters">
<argument name="data" xsi:type="array">
<item name="config" xsi:type="array">
<item name="columnsProvider" xsi:type="string">productattachments_listing.productattachments_listing.productattachments_columns</item>
<item name="storageConfig" xsi:type="array">
<item name="provider" xsi:type="string">productattachments_listing.productattachments_listing.listing_top.bookmarks</item>
<item name="namespace" xsi:type="string">current.filters</item>
</item>
<item name="templates" xsi:type="array">
<item name="filters" xsi:type="array">
<item name="select" xsi:type="array">
<item name="component" xsi:type="string">Magento_Ui/js/form/element/ui-select</item>
<item name="template" xsi:type="string">ui/grid/filters/elements/ui-select</item>
</item>
</item>
</item>
<item name="childDefaults" xsi:type="array">
<item name="provider" xsi:type="string">productattachments_listing.productattachments_listing.listing_top.listing_filters</item>
<item name="imports" xsi:type="array">
<item name="visible" xsi:type="string">productattachments_listing.productattachments_listing.productattachments_columns.$ $.index :visible</item>
</item>
</item>
</item>
<item name="observers" xsi:type="array">
<item name="column" xsi:type="string">column</item>
</item>
</argument>
<filterSelect name="store_id">
<argument name="optionsProvider" xsi:type="configurableObject">
<argument name="class" xsi:type="string">MagentoCmsUiComponentListingColumnCmsOptions</argument>
</argument>
<argument name="data" xsi:type="array">
<item name="config" xsi:type="array">
<item name="dataScope" xsi:type="string">store_id</item>
<item name="label" xsi:type="string" translate="true">Store View</item>
<item name="captionValue" xsi:type="string">0</item>
</item>
</argument>
</filterSelect>
</filters>
<massaction name="listing_massaction">
<argument name="data" xsi:type="array">
<item name="config" xsi:type="array">
<item name="selectProvider" xsi:type="string">productattachments_listing.productattachments_listing.productattachments_columns.ids</item>
<item name="indexField" xsi:type="string">productattachments_id</item>
</item>
</argument>
<action name="delete">
<argument name="data" xsi:type="array">
<item name="config" xsi:type="array">
<item name="type" xsi:type="string">delete</item>
<item name="label" xsi:type="string" translate="true">Delete</item>
<item name="url" xsi:type="url" path="productattachmentsadmin/productattachments/massDelete"/>
<item name="confirm" xsi:type="array">
<item name="title" xsi:type="string" translate="true">Delete items</item>
<item name="message" xsi:type="string" translate="true">Are you sure you wan't to delete selected items?</item>
</item>
</item>
</argument>
</action>
<action name="disable">
<argument name="data" xsi:type="array">
<item name="config" xsi:type="array">
<item name="type" xsi:type="string">disable</item>
<item name="label" xsi:type="string" translate="true">Disable</item>
<item name="url" xsi:type="url" path="productattachmentsadmin/productattachments/massDisable"/>
</item>
</argument>
</action>
<action name="enable">
<argument name="data" xsi:type="array">
<item name="config" xsi:type="array">
<item name="type" xsi:type="string">enable</item>
<item name="label" xsi:type="string" translate="true">Enable</item>
<item name="url" xsi:type="url" path="productattachmentsadmin/productattachments/massEnable"/>
</item>
</argument>
</action>
<action name="edit">
<argument name="data" xsi:type="array">
<item name="config" xsi:type="array">
<item name="type" xsi:type="string">edit</item>
<item name="label" xsi:type="string" translate="true">Edit</item>
<item name="callback" xsi:type="array">
<item name="provider" xsi:type="string">productattachments_listing.productattachments_listing.productattachments_columns_editor</item>
<item name="target" xsi:type="string">editSelected</item>
</item>
</item>
</argument>
</action>
</massaction>
<paging name="listing_paging">
<argument name="data" xsi:type="array">
<item name="config" xsi:type="array">
<item name="storageConfig" xsi:type="array">
<item name="provider" xsi:type="string">productattachments_listing.productattachments_listing.listing_top.bookmarks</item>
<item name="namespace" xsi:type="string">current.paging</item>
</item>
<item name="selectProvider" xsi:type="string">productattachments_listing.productattachments_listing.productattachments_columns.ids</item>
</item>
</argument>
</paging>
</container>
magento2 admin grid uicomponent pagination
In magento admin, custom grid pagination is not working. I have 3 records in database, When I enter 2 records/page then next page button remains disabled and it will not show remaining 1 record.
This is Default setting when page is loaded.
This is the actual issue.
As soon as i type 2 and press enter it shows correct values until the grid is loading as in below image.But when grid loaded it will not show remaining record.
Below is the code of grid xml before columns
<listing xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Ui:etc/ui_configuration.xsd">
<argument name="data" xsi:type="array">
<item name="js_config" xsi:type="array">
<item name="provider" xsi:type="string">productattachments_listing.productattachments_listing_data_source</item>
<item name="deps" xsi:type="string">productattachments_listing.productattachments_listing_data_source</item>
</item>
<item name="spinner" xsi:type="string">productattachments_columns</item>
<item name="buttons" xsi:type="array">
<item name="add" xsi:type="array">
<item name="name" xsi:type="string">add</item>
<item name="label" xsi:type="string" translate="true">Add New File</item>
<item name="class" xsi:type="string">primary</item>
<item name="url" xsi:type="string">*/*/new</item>
</item>
</item>
</argument>
<dataSource name="productattachments_listing_data_source">
<argument name="dataProvider" xsi:type="configurableObject">
<argument name="class" xsi:type="string">ProductattachmentsGridDataProvider</argument>
<argument name="name" xsi:type="string">productattachments_listing_data_source</argument>
<argument name="primaryFieldName" xsi:type="string">productattachments_id</argument>
<argument name="requestFieldName" xsi:type="string">id</argument>
<argument name="data" xsi:type="array">
<item name="config" xsi:type="array">
<item name="update_url" xsi:type="url" path="mui/index/render"/>
</item>
</argument>
</argument>
<argument name="data" xsi:type="array">
<item name="js_config" xsi:type="array">
<item name="component" xsi:type="string">Magento_Ui/js/grid/provider</item>
</item>
</argument>
</dataSource>
<container name="listing_top">
<argument name="data" xsi:type="array">
<item name="config" xsi:type="array">
<item name="template" xsi:type="string">ui/grid/toolbar</item>
<item name="stickyTmpl" xsi:type="string">ui/grid/sticky/toolbar</item>
</item>
</argument>
<bookmark name="bookmarks">
<argument name="data" xsi:type="array">
<item name="config" xsi:type="array">
<item name="storageConfig" xsi:type="array">
<item name="namespace" xsi:type="string">productattachments_listing</item>
</item>
</item>
</argument>
</bookmark>
<component name="columns_controls">
<argument name="data" xsi:type="array">
<item name="config" xsi:type="array">
<item name="columnsData" xsi:type="array">
<item name="provider" xsi:type="string">productattachments_listing.productattachments_listing.productattachments_columns</item>
</item>
<item name="component" xsi:type="string">Magento_Ui/js/grid/controls/columns</item>
<item name="displayArea" xsi:type="string">dataGridActions</item>
</item>
</argument>
</component>
<filters name="listing_filters">
<argument name="data" xsi:type="array">
<item name="config" xsi:type="array">
<item name="columnsProvider" xsi:type="string">productattachments_listing.productattachments_listing.productattachments_columns</item>
<item name="storageConfig" xsi:type="array">
<item name="provider" xsi:type="string">productattachments_listing.productattachments_listing.listing_top.bookmarks</item>
<item name="namespace" xsi:type="string">current.filters</item>
</item>
<item name="templates" xsi:type="array">
<item name="filters" xsi:type="array">
<item name="select" xsi:type="array">
<item name="component" xsi:type="string">Magento_Ui/js/form/element/ui-select</item>
<item name="template" xsi:type="string">ui/grid/filters/elements/ui-select</item>
</item>
</item>
</item>
<item name="childDefaults" xsi:type="array">
<item name="provider" xsi:type="string">productattachments_listing.productattachments_listing.listing_top.listing_filters</item>
<item name="imports" xsi:type="array">
<item name="visible" xsi:type="string">productattachments_listing.productattachments_listing.productattachments_columns.$ $.index :visible</item>
</item>
</item>
</item>
<item name="observers" xsi:type="array">
<item name="column" xsi:type="string">column</item>
</item>
</argument>
<filterSelect name="store_id">
<argument name="optionsProvider" xsi:type="configurableObject">
<argument name="class" xsi:type="string">MagentoCmsUiComponentListingColumnCmsOptions</argument>
</argument>
<argument name="data" xsi:type="array">
<item name="config" xsi:type="array">
<item name="dataScope" xsi:type="string">store_id</item>
<item name="label" xsi:type="string" translate="true">Store View</item>
<item name="captionValue" xsi:type="string">0</item>
</item>
</argument>
</filterSelect>
</filters>
<massaction name="listing_massaction">
<argument name="data" xsi:type="array">
<item name="config" xsi:type="array">
<item name="selectProvider" xsi:type="string">productattachments_listing.productattachments_listing.productattachments_columns.ids</item>
<item name="indexField" xsi:type="string">productattachments_id</item>
</item>
</argument>
<action name="delete">
<argument name="data" xsi:type="array">
<item name="config" xsi:type="array">
<item name="type" xsi:type="string">delete</item>
<item name="label" xsi:type="string" translate="true">Delete</item>
<item name="url" xsi:type="url" path="productattachmentsadmin/productattachments/massDelete"/>
<item name="confirm" xsi:type="array">
<item name="title" xsi:type="string" translate="true">Delete items</item>
<item name="message" xsi:type="string" translate="true">Are you sure you wan't to delete selected items?</item>
</item>
</item>
</argument>
</action>
<action name="disable">
<argument name="data" xsi:type="array">
<item name="config" xsi:type="array">
<item name="type" xsi:type="string">disable</item>
<item name="label" xsi:type="string" translate="true">Disable</item>
<item name="url" xsi:type="url" path="productattachmentsadmin/productattachments/massDisable"/>
</item>
</argument>
</action>
<action name="enable">
<argument name="data" xsi:type="array">
<item name="config" xsi:type="array">
<item name="type" xsi:type="string">enable</item>
<item name="label" xsi:type="string" translate="true">Enable</item>
<item name="url" xsi:type="url" path="productattachmentsadmin/productattachments/massEnable"/>
</item>
</argument>
</action>
<action name="edit">
<argument name="data" xsi:type="array">
<item name="config" xsi:type="array">
<item name="type" xsi:type="string">edit</item>
<item name="label" xsi:type="string" translate="true">Edit</item>
<item name="callback" xsi:type="array">
<item name="provider" xsi:type="string">productattachments_listing.productattachments_listing.productattachments_columns_editor</item>
<item name="target" xsi:type="string">editSelected</item>
</item>
</item>
</argument>
</action>
</massaction>
<paging name="listing_paging">
<argument name="data" xsi:type="array">
<item name="config" xsi:type="array">
<item name="storageConfig" xsi:type="array">
<item name="provider" xsi:type="string">productattachments_listing.productattachments_listing.listing_top.bookmarks</item>
<item name="namespace" xsi:type="string">current.paging</item>
</item>
<item name="selectProvider" xsi:type="string">productattachments_listing.productattachments_listing.productattachments_columns.ids</item>
</item>
</argument>
</paging>
</container>
magento2 admin grid uicomponent pagination
magento2 admin grid uicomponent pagination
edited Feb 23 '17 at 6:58
Ashar Riaz
asked Feb 23 '17 at 6:06
Ashar RiazAshar Riaz
508519
508519
check the network tab from browser is there any error coming.
– Prasanta Hatui
Feb 23 '17 at 6:13
no error in network tab. i have also checked grid code line by line and cant find any issue.
– Ashar Riaz
Feb 23 '17 at 6:34
there is another issue when i change records/page to previous one then grid is filled with all dublicate values.
– Ashar Riaz
Feb 23 '17 at 6:36
did u added grid collection model?
– Prasanta Hatui
Feb 23 '17 at 6:44
yes i have added grid collection model. I have edit my question and add 3rd screenshot.
– Ashar Riaz
Feb 23 '17 at 6:59
add a comment |
check the network tab from browser is there any error coming.
– Prasanta Hatui
Feb 23 '17 at 6:13
no error in network tab. i have also checked grid code line by line and cant find any issue.
– Ashar Riaz
Feb 23 '17 at 6:34
there is another issue when i change records/page to previous one then grid is filled with all dublicate values.
– Ashar Riaz
Feb 23 '17 at 6:36
did u added grid collection model?
– Prasanta Hatui
Feb 23 '17 at 6:44
yes i have added grid collection model. I have edit my question and add 3rd screenshot.
– Ashar Riaz
Feb 23 '17 at 6:59
check the network tab from browser is there any error coming.
– Prasanta Hatui
Feb 23 '17 at 6:13
check the network tab from browser is there any error coming.
– Prasanta Hatui
Feb 23 '17 at 6:13
no error in network tab. i have also checked grid code line by line and cant find any issue.
– Ashar Riaz
Feb 23 '17 at 6:34
no error in network tab. i have also checked grid code line by line and cant find any issue.
– Ashar Riaz
Feb 23 '17 at 6:34
there is another issue when i change records/page to previous one then grid is filled with all dublicate values.
– Ashar Riaz
Feb 23 '17 at 6:36
there is another issue when i change records/page to previous one then grid is filled with all dublicate values.
– Ashar Riaz
Feb 23 '17 at 6:36
did u added grid collection model?
– Prasanta Hatui
Feb 23 '17 at 6:44
did u added grid collection model?
– Prasanta Hatui
Feb 23 '17 at 6:44
yes i have added grid collection model. I have edit my question and add 3rd screenshot.
– Ashar Riaz
Feb 23 '17 at 6:59
yes i have added grid collection model. I have edit my question and add 3rd screenshot.
– Ashar Riaz
Feb 23 '17 at 6:59
add a comment |
2 Answers
2
active
oldest
votes
In the:
<dataSource name="productattachments_listing_data_source">
You should add these lines to dataProvider:
<item name="storageConfig" xsi:type="array">
<item name="indexField" xsi:type="string">YOUR_INDEX_FIELD</item>
</item>
So in a result it will look like this:
<dataSource name="productattachments_listing_data_source">
<argument name="dataProvider" xsi:type="configurableObject">
<argument name="class" xsi:type="string">ProductattachmentsGridDataProvider</argument>
<argument name="name" xsi:type="string">productattachments_listing_data_source</argument>
<argument name="primaryFieldName" xsi:type="string">productattachments_id</argument>
<argument name="requestFieldName" xsi:type="string">id</argument>
<argument name="data" xsi:type="array">
<item name="config" xsi:type="array">
<item name="update_url" xsi:type="url" path="mui/index/render"/>
<item name="storageConfig" xsi:type="array">
<item name="indexField" xsi:type="string"> productattachments_id</item>
</item>
</item>
</argument>
</argument>
<argument name="data" xsi:type="array">
<item name="js_config" xsi:type="array">
<item name="component" xsi:type="string">Magento_Ui/js/grid/provider</item>
</item>
</argument>
</dataSource>
Also, you forget to close "listing" tag
The issue was in model/ResourceModel/Modulename/Grid/Collection.php
– Ashar Riaz
Apr 25 '17 at 10:46
add a comment |
The issue was in grid collection file.
After implementing all SearchResultInterface methods the issue was gone.
add a comment |
Your Answer
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "479"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmagento.stackexchange.com%2fquestions%2f161417%2fmagento-2-admin-grid-pagination-issue%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
In the:
<dataSource name="productattachments_listing_data_source">
You should add these lines to dataProvider:
<item name="storageConfig" xsi:type="array">
<item name="indexField" xsi:type="string">YOUR_INDEX_FIELD</item>
</item>
So in a result it will look like this:
<dataSource name="productattachments_listing_data_source">
<argument name="dataProvider" xsi:type="configurableObject">
<argument name="class" xsi:type="string">ProductattachmentsGridDataProvider</argument>
<argument name="name" xsi:type="string">productattachments_listing_data_source</argument>
<argument name="primaryFieldName" xsi:type="string">productattachments_id</argument>
<argument name="requestFieldName" xsi:type="string">id</argument>
<argument name="data" xsi:type="array">
<item name="config" xsi:type="array">
<item name="update_url" xsi:type="url" path="mui/index/render"/>
<item name="storageConfig" xsi:type="array">
<item name="indexField" xsi:type="string"> productattachments_id</item>
</item>
</item>
</argument>
</argument>
<argument name="data" xsi:type="array">
<item name="js_config" xsi:type="array">
<item name="component" xsi:type="string">Magento_Ui/js/grid/provider</item>
</item>
</argument>
</dataSource>
Also, you forget to close "listing" tag
The issue was in model/ResourceModel/Modulename/Grid/Collection.php
– Ashar Riaz
Apr 25 '17 at 10:46
add a comment |
In the:
<dataSource name="productattachments_listing_data_source">
You should add these lines to dataProvider:
<item name="storageConfig" xsi:type="array">
<item name="indexField" xsi:type="string">YOUR_INDEX_FIELD</item>
</item>
So in a result it will look like this:
<dataSource name="productattachments_listing_data_source">
<argument name="dataProvider" xsi:type="configurableObject">
<argument name="class" xsi:type="string">ProductattachmentsGridDataProvider</argument>
<argument name="name" xsi:type="string">productattachments_listing_data_source</argument>
<argument name="primaryFieldName" xsi:type="string">productattachments_id</argument>
<argument name="requestFieldName" xsi:type="string">id</argument>
<argument name="data" xsi:type="array">
<item name="config" xsi:type="array">
<item name="update_url" xsi:type="url" path="mui/index/render"/>
<item name="storageConfig" xsi:type="array">
<item name="indexField" xsi:type="string"> productattachments_id</item>
</item>
</item>
</argument>
</argument>
<argument name="data" xsi:type="array">
<item name="js_config" xsi:type="array">
<item name="component" xsi:type="string">Magento_Ui/js/grid/provider</item>
</item>
</argument>
</dataSource>
Also, you forget to close "listing" tag
The issue was in model/ResourceModel/Modulename/Grid/Collection.php
– Ashar Riaz
Apr 25 '17 at 10:46
add a comment |
In the:
<dataSource name="productattachments_listing_data_source">
You should add these lines to dataProvider:
<item name="storageConfig" xsi:type="array">
<item name="indexField" xsi:type="string">YOUR_INDEX_FIELD</item>
</item>
So in a result it will look like this:
<dataSource name="productattachments_listing_data_source">
<argument name="dataProvider" xsi:type="configurableObject">
<argument name="class" xsi:type="string">ProductattachmentsGridDataProvider</argument>
<argument name="name" xsi:type="string">productattachments_listing_data_source</argument>
<argument name="primaryFieldName" xsi:type="string">productattachments_id</argument>
<argument name="requestFieldName" xsi:type="string">id</argument>
<argument name="data" xsi:type="array">
<item name="config" xsi:type="array">
<item name="update_url" xsi:type="url" path="mui/index/render"/>
<item name="storageConfig" xsi:type="array">
<item name="indexField" xsi:type="string"> productattachments_id</item>
</item>
</item>
</argument>
</argument>
<argument name="data" xsi:type="array">
<item name="js_config" xsi:type="array">
<item name="component" xsi:type="string">Magento_Ui/js/grid/provider</item>
</item>
</argument>
</dataSource>
Also, you forget to close "listing" tag
In the:
<dataSource name="productattachments_listing_data_source">
You should add these lines to dataProvider:
<item name="storageConfig" xsi:type="array">
<item name="indexField" xsi:type="string">YOUR_INDEX_FIELD</item>
</item>
So in a result it will look like this:
<dataSource name="productattachments_listing_data_source">
<argument name="dataProvider" xsi:type="configurableObject">
<argument name="class" xsi:type="string">ProductattachmentsGridDataProvider</argument>
<argument name="name" xsi:type="string">productattachments_listing_data_source</argument>
<argument name="primaryFieldName" xsi:type="string">productattachments_id</argument>
<argument name="requestFieldName" xsi:type="string">id</argument>
<argument name="data" xsi:type="array">
<item name="config" xsi:type="array">
<item name="update_url" xsi:type="url" path="mui/index/render"/>
<item name="storageConfig" xsi:type="array">
<item name="indexField" xsi:type="string"> productattachments_id</item>
</item>
</item>
</argument>
</argument>
<argument name="data" xsi:type="array">
<item name="js_config" xsi:type="array">
<item name="component" xsi:type="string">Magento_Ui/js/grid/provider</item>
</item>
</argument>
</dataSource>
Also, you forget to close "listing" tag
answered Apr 25 '17 at 9:37
Mateusz TofilskiMateusz Tofilski
1
1
The issue was in model/ResourceModel/Modulename/Grid/Collection.php
– Ashar Riaz
Apr 25 '17 at 10:46
add a comment |
The issue was in model/ResourceModel/Modulename/Grid/Collection.php
– Ashar Riaz
Apr 25 '17 at 10:46
The issue was in model/ResourceModel/Modulename/Grid/Collection.php
– Ashar Riaz
Apr 25 '17 at 10:46
The issue was in model/ResourceModel/Modulename/Grid/Collection.php
– Ashar Riaz
Apr 25 '17 at 10:46
add a comment |
The issue was in grid collection file.
After implementing all SearchResultInterface methods the issue was gone.
add a comment |
The issue was in grid collection file.
After implementing all SearchResultInterface methods the issue was gone.
add a comment |
The issue was in grid collection file.
After implementing all SearchResultInterface methods the issue was gone.
The issue was in grid collection file.
After implementing all SearchResultInterface methods the issue was gone.
edited Jan 11 at 12:02
answered Apr 25 '17 at 10:49
Ashar RiazAshar Riaz
508519
508519
add a comment |
add a comment |
Thanks for contributing an answer to Magento Stack Exchange!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmagento.stackexchange.com%2fquestions%2f161417%2fmagento-2-admin-grid-pagination-issue%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
check the network tab from browser is there any error coming.
– Prasanta Hatui
Feb 23 '17 at 6:13
no error in network tab. i have also checked grid code line by line and cant find any issue.
– Ashar Riaz
Feb 23 '17 at 6:34
there is another issue when i change records/page to previous one then grid is filled with all dublicate values.
– Ashar Riaz
Feb 23 '17 at 6:36
did u added grid collection model?
– Prasanta Hatui
Feb 23 '17 at 6:44
yes i have added grid collection model. I have edit my question and add 3rd screenshot.
– Ashar Riaz
Feb 23 '17 at 6:59