In Magento 2.1, there are 25 total UI Component listing/grid data providers configured and in use. Their data provider classes and ui_component
files are listed below
Magento\Bundle\Ui\DataProvider\Product\BundleDataProvider bundle_product_listing.xmlMagento\Catalog\Ui\DataProvider\Product\Attributes\Listing product_attributes_grid.xml
Magento\Catalog\Ui\DataProvider\Product\ProductCustomOptionsDataProvider product_custom_options_listing.xml
Magento\Catalog\Ui\DataProvider\Product\ProductDataProvider configurable_associated_product_listing.xml
Magento\Catalog\Ui\DataProvider\Product\ProductDataProvider product_listing.xml
Magento\Catalog\Ui\DataProvider\Product\Related\CrossSellDataProvider crosssell_product_listing.xml
Magento\Catalog\Ui\DataProvider\Product\Related\RelatedDataProvider related_product_listing.xml
Magento\Catalog\Ui\DataProvider\Product\Related\UpSellDataProvider upsell_product_listing.xml
Magento\Cms\Ui\Component\DataProvider cms_block_listing.xml
Magento\Cms\Ui\Component\DataProvider cms_page_listing.xml
Magento\ConfigurableProduct\Ui\DataProvider\Attributes product_attributes_listing.xml
Magento\Customer\Ui\Component\DataProvider customer_listing.xml
Magento\Framework\View\Element\UiComponent\DataProvider\DataProvider customer_online_grid.xml
Magento\Framework\View\Element\UiComponent\DataProvider\DataProvider sales_order_creditmemo_grid.xml
Magento\Framework\View\Element\UiComponent\DataProvider\DataProvider sales_order_grid.xml
Magento\Framework\View\Element\UiComponent\DataProvider\DataProvider sales_order_invoice_grid.xml
Magento\Framework\View\Element\UiComponent\DataProvider\DataProvider sales_order_shipment_grid.xml
Magento\Framework\View\Element\UiComponent\DataProvider\DataProvider sales_order_view_creditmemo_grid.xml
Magento\Framework\View\Element\UiComponent\DataProvider\DataProvider sales_order_view_invoice_grid.xml
Magento\Framework\View\Element\UiComponent\DataProvider\DataProvider sales_order_view_shipment_grid.xml
Magento\Framework\View\Element\UiComponent\DataProvider\DataProvider search_synonyms_grid.xml
BraintreeTransactionsDataProvider (virtual type) braintree_report.xml
Magento\Framework\View\Element\UiComponent\DataProvider\DataProvider
Magento\GroupedProduct\Ui\DataProvider\Product\GroupedProductDataProvider grouped_product_listing.xml
Magento\Review\Ui\DataProvider\Product\ReviewDataProvider review_listing.xml
Magento\Theme\Ui\Component\Design\Config\DataProvider design_config_listing.xml
Based on this information, there appear to be two base classes end user programmers can use to base their grid components on
- Magento\Framework\View\Element\UiComponent\DataProvider\DataProvider
- Magento\Ui\DataProvider\AbstractDataProvider
The Magento\Ui\DataProvider\AbstractDataProvider
class seems to simpler of the two, and (seems to?) only requires the configuration of a Magento resource model. The customer grid Magento\Customer\Ui\Component\DataProvider
module is based on this class, and appears to have all sorting, filtering, etc. functionality needed for a grid listing.
Is there a reason the Magento\Framework\View\Element\UiComponent\DataProvider\DataProvider
exists -- or is it just older/newer code that take a different approach to creating a data provider? In other words, does using the Magento\Framework\View\Element\UiComponent\DataProvider\DataProvider
bring any extra features to the table, or enable other parts of the system to do things with the grid? Looking at the source code, the Magento\Framework\App\RequestInterface
seems intriguing -- as it implies you might be reporting functionality "for free" with these grids. However, without an extensive code safari, I'm not sure if that's true or not, and I'm hoping someone has a clear explanation of why you'd use one class over the other.