Add admin pagination with custom array of data?
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
add a comment |
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
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
add a comment |
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
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
magento2
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
add a comment |
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
add a comment |
1 Answer
1
active
oldest
votes
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>
can you please explain how this will apply for custom array data?
– iqbal malik
54 secs ago
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');
var $window = $(window),
onScroll = function(e) {
var $elem = $('.new-login-left'),
docViewTop = $window.scrollTop(),
docViewBottom = docViewTop + $window.height(),
elemTop = $elem.offset().top,
elemBottom = elemTop + $elem.height();
if ((docViewTop elemBottom)) {
StackExchange.using('gps', function() { StackExchange.gps.track('embedded_signup_form.view', { location: 'question_page' }); });
$window.unbind('scroll', onScroll);
}
};
$window.on('scroll', onScroll);
});
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%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
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>
can you please explain how this will apply for custom array data?
– iqbal malik
54 secs ago
add a comment |
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>
can you please explain how this will apply for custom array data?
– iqbal malik
54 secs ago
add a comment |
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>
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>
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
add a comment |
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
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');
var $window = $(window),
onScroll = function(e) {
var $elem = $('.new-login-left'),
docViewTop = $window.scrollTop(),
docViewBottom = docViewTop + $window.height(),
elemTop = $elem.offset().top,
elemBottom = elemTop + $elem.height();
if ((docViewTop elemBottom)) {
StackExchange.using('gps', function() { StackExchange.gps.track('embedded_signup_form.view', { location: 'question_page' }); });
$window.unbind('scroll', onScroll);
}
};
$window.on('scroll', onScroll);
});
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%2f262959%2fadd-admin-pagination-with-custom-array-of-data%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');
var $window = $(window),
onScroll = function(e) {
var $elem = $('.new-login-left'),
docViewTop = $window.scrollTop(),
docViewBottom = docViewTop + $window.height(),
elemTop = $elem.offset().top,
elemBottom = elemTop + $elem.height();
if ((docViewTop elemBottom)) {
StackExchange.using('gps', function() { StackExchange.gps.track('embedded_signup_form.view', { location: 'question_page' }); });
$window.unbind('scroll', onScroll);
}
};
$window.on('scroll', onScroll);
});
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');
var $window = $(window),
onScroll = function(e) {
var $elem = $('.new-login-left'),
docViewTop = $window.scrollTop(),
docViewBottom = docViewTop + $window.height(),
elemTop = $elem.offset().top,
elemBottom = elemTop + $elem.height();
if ((docViewTop elemBottom)) {
StackExchange.using('gps', function() { StackExchange.gps.track('embedded_signup_form.view', { location: 'question_page' }); });
$window.unbind('scroll', onScroll);
}
};
$window.on('scroll', onScroll);
});
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');
var $window = $(window),
onScroll = function(e) {
var $elem = $('.new-login-left'),
docViewTop = $window.scrollTop(),
docViewBottom = docViewTop + $window.height(),
elemTop = $elem.offset().top,
elemBottom = elemTop + $elem.height();
if ((docViewTop elemBottom)) {
StackExchange.using('gps', function() { StackExchange.gps.track('embedded_signup_form.view', { location: 'question_page' }); });
$window.unbind('scroll', onScroll);
}
};
$window.on('scroll', onScroll);
});
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
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