Add admin pagination with custom array of data?












0















I have an array with the structure like:



$list = array(
'0' => array(
'name' => 'First',
'version' => '1',
),
'1' => array(
'name' => 'second',
'version' => '2',
),
'2' => array(
'name' => 'third',
'version' => '3',
),
'3' => array(
'name' => 'fourth',
'version' => '4',
),
...So on...




I am showing this array data in custom html table using phtml file. Now, i want to add pagination and a search box with this table. What is the best way to do so in Magento 2.


Please Help..!!










share|improve this question























  • where you want to show ? in admin or on frontend ?

    – Hassan Ali Shahzad
    22 mins ago











  • In admin, i have created a custom page and page having table working fine. But now i want to add pagination on the table and a search box.

    – iqbal malik
    14 mins ago
















0















I have an array with the structure like:



$list = array(
'0' => array(
'name' => 'First',
'version' => '1',
),
'1' => array(
'name' => 'second',
'version' => '2',
),
'2' => array(
'name' => 'third',
'version' => '3',
),
'3' => array(
'name' => 'fourth',
'version' => '4',
),
...So on...




I am showing this array data in custom html table using phtml file. Now, i want to add pagination and a search box with this table. What is the best way to do so in Magento 2.


Please Help..!!










share|improve this question























  • where you want to show ? in admin or on frontend ?

    – Hassan Ali Shahzad
    22 mins ago











  • In admin, i have created a custom page and page having table working fine. But now i want to add pagination on the table and a search box.

    – iqbal malik
    14 mins ago














0












0








0








I have an array with the structure like:



$list = array(
'0' => array(
'name' => 'First',
'version' => '1',
),
'1' => array(
'name' => 'second',
'version' => '2',
),
'2' => array(
'name' => 'third',
'version' => '3',
),
'3' => array(
'name' => 'fourth',
'version' => '4',
),
...So on...




I am showing this array data in custom html table using phtml file. Now, i want to add pagination and a search box with this table. What is the best way to do so in Magento 2.


Please Help..!!










share|improve this question














I have an array with the structure like:



$list = array(
'0' => array(
'name' => 'First',
'version' => '1',
),
'1' => array(
'name' => 'second',
'version' => '2',
),
'2' => array(
'name' => 'third',
'version' => '3',
),
'3' => array(
'name' => 'fourth',
'version' => '4',
),
...So on...




I am showing this array data in custom html table using phtml file. Now, i want to add pagination and a search box with this table. What is the best way to do so in Magento 2.


Please Help..!!







magento2






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked 33 mins ago









iqbal malikiqbal malik

9411




9411













  • where you want to show ? in admin or on frontend ?

    – Hassan Ali Shahzad
    22 mins ago











  • In admin, i have created a custom page and page having table working fine. But now i want to add pagination on the table and a search box.

    – iqbal malik
    14 mins ago



















  • where you want to show ? in admin or on frontend ?

    – Hassan Ali Shahzad
    22 mins ago











  • In admin, i have created a custom page and page having table working fine. But now i want to add pagination on the table and a search box.

    – iqbal malik
    14 mins ago

















where you want to show ? in admin or on frontend ?

– Hassan Ali Shahzad
22 mins ago





where you want to show ? in admin or on frontend ?

– Hassan Ali Shahzad
22 mins ago













In admin, i have created a custom page and page having table working fine. But now i want to add pagination on the table and a search box.

– iqbal malik
14 mins ago





In admin, i have created a custom page and page having table working fine. But now i want to add pagination on the table and a search box.

– iqbal malik
14 mins ago










1 Answer
1






active

oldest

votes


















0














for that consider the following example from devdocs:
To enable pagination for the listing component, the pagination component is declared as a child of the listing component in component instance configuration.



Example:



/view/adminhtml/ui_component/cms_page_listing.xml



<listing xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Ui:etc/ui_configuration.xsd">
<container name="page_listing_top">
<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">cms_block_listing.cms_block_listing.listing_top.bookmarks</item>
<item name="namespace" xsi:type="string">current.paging</item>
</item>
<item name="selectProvider" xsi:type="string">cms_block_listing.cms_block_listing.cms_block_columns.ids</item>
</item>
</argument>
</paging>
</container>
</listing>




share
























  • can you please explain how this will apply for custom array data?

    – iqbal malik
    54 secs ago











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
});


}
});














draft saved

draft discarded


















StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmagento.stackexchange.com%2fquestions%2f262959%2fadd-admin-pagination-with-custom-array-of-data%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown

























1 Answer
1






active

oldest

votes








1 Answer
1






active

oldest

votes









active

oldest

votes






active

oldest

votes









0














for that consider the following example from devdocs:
To enable pagination for the listing component, the pagination component is declared as a child of the listing component in component instance configuration.



Example:



/view/adminhtml/ui_component/cms_page_listing.xml



<listing xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Ui:etc/ui_configuration.xsd">
<container name="page_listing_top">
<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">cms_block_listing.cms_block_listing.listing_top.bookmarks</item>
<item name="namespace" xsi:type="string">current.paging</item>
</item>
<item name="selectProvider" xsi:type="string">cms_block_listing.cms_block_listing.cms_block_columns.ids</item>
</item>
</argument>
</paging>
</container>
</listing>




share
























  • can you please explain how this will apply for custom array data?

    – iqbal malik
    54 secs ago
















0














for that consider the following example from devdocs:
To enable pagination for the listing component, the pagination component is declared as a child of the listing component in component instance configuration.



Example:



/view/adminhtml/ui_component/cms_page_listing.xml



<listing xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Ui:etc/ui_configuration.xsd">
<container name="page_listing_top">
<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">cms_block_listing.cms_block_listing.listing_top.bookmarks</item>
<item name="namespace" xsi:type="string">current.paging</item>
</item>
<item name="selectProvider" xsi:type="string">cms_block_listing.cms_block_listing.cms_block_columns.ids</item>
</item>
</argument>
</paging>
</container>
</listing>




share
























  • can you please explain how this will apply for custom array data?

    – iqbal malik
    54 secs ago














0












0








0







for that consider the following example from devdocs:
To enable pagination for the listing component, the pagination component is declared as a child of the listing component in component instance configuration.



Example:



/view/adminhtml/ui_component/cms_page_listing.xml



<listing xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Ui:etc/ui_configuration.xsd">
<container name="page_listing_top">
<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">cms_block_listing.cms_block_listing.listing_top.bookmarks</item>
<item name="namespace" xsi:type="string">current.paging</item>
</item>
<item name="selectProvider" xsi:type="string">cms_block_listing.cms_block_listing.cms_block_columns.ids</item>
</item>
</argument>
</paging>
</container>
</listing>




share













for that consider the following example from devdocs:
To enable pagination for the listing component, the pagination component is declared as a child of the listing component in component instance configuration.



Example:



/view/adminhtml/ui_component/cms_page_listing.xml



<listing xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Ui:etc/ui_configuration.xsd">
<container name="page_listing_top">
<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">cms_block_listing.cms_block_listing.listing_top.bookmarks</item>
<item name="namespace" xsi:type="string">current.paging</item>
</item>
<item name="selectProvider" xsi:type="string">cms_block_listing.cms_block_listing.cms_block_columns.ids</item>
</item>
</argument>
</paging>
</container>
</listing>





share











share


share










answered 8 mins ago









Hassan Ali ShahzadHassan Ali Shahzad

539216




539216













  • can you please explain how this will apply for custom array data?

    – iqbal malik
    54 secs ago



















  • can you please explain how this will apply for custom array data?

    – iqbal malik
    54 secs ago

















can you please explain how this will apply for custom array data?

– iqbal malik
54 secs ago





can you please explain how this will apply for custom array data?

– iqbal malik
54 secs ago


















draft saved

draft discarded




















































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.




draft saved


draft discarded














StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmagento.stackexchange.com%2fquestions%2f262959%2fadd-admin-pagination-with-custom-array-of-data%23new-answer', 'question_page');
}
);

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







Popular posts from this blog

Polycentropodidae

Magento 2 Error message: Invalid state change requested

Paulmy