0

I'm facing a problem and i didn't find solution on Internet or on Adobe Documentation. I'm using Magento 2.4.7-p3

I would like to display all of the cron definitions in an admin grid listing. About getting the data, i have no problem, i'm calling the Class Magento\Cron\Model\ConfigInterface and then getJobs method to get all cron definitions. It works fine.

My problem is : i don't have any clue on how to display non-db data in an admin listing. I followed a tutorial here : https://www.azguards.com/magento/customizing-magento-2-admin-grid-using-ui-components/, my current code is very similar to this.
At first sight, it seems great, but the code presented in this tutorial as some flaws:

  • Pagination doesn't work, i have to do something like that
$pagesize = intval($this->request->getParam('paging')['pageSize'] ?? 20);
$pageCurrent = intval($this->request->getParam('paging')['current'] ?? 1);
$pageoffset = ($pageCurrent - 1)*$pagesize;
return [
 'totalRecords' => count($items),
 'items' => array_slice($items, $pageoffset, $pagesize),
];
  • Filters and ordering don't work too.

So my questions are

  • Are Magento Admin Grid designed to handle non-db items/entities?
  • Could the method presented above work, provided that you reinvent the wheel in certain parts (pagination, filters, etc.)?
  • Is it possible to create a Model Triad (Model/ResourceModel/Collection) which does not rely on db data, that i could use in my Admin Grid?

Thanks a lot for your responses, i'm available if you have any question :)

Edit 25/04/2025 : still looking for a solution, does anyone have any hint?

asked Feb 6 at 11:11
1
  • Hi, available again, still looking for a solution Commented Apr 25 at 9:54

0

Know someone who can answer? Share a link to this question via email, Twitter, or Facebook.

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.