1

What difference between magento 2-dev-beta grid creation and Magento 2 release. When i update magento to release version i saw this: enter image description here

Can someone explain to me what i need to delete or add?

UPDATE:

di.xml

<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd">
<preference for="Webinse\Crm\Api\Data\RemindersInterface" type="Webinse\Crm\Model\Reminders"/>
<virtualType name="CrmGirdFilterPool" type="Magento\Framework\View\Element\UiComponent\DataProvider\FilterPool">
    <arguments>
        <argument name="appliers" xsi:type="array">
            <item name="regular"
                  xsi:type="object">Magento\Framework\View\Element\UiComponent\DataProvider\RegularFilter
            </item>
            <item name="fulltext"
                  xsi:type="object">Magento\Framework\View\Element\UiComponent\DataProvider\FulltextFilter
            </item>
        </argument>
    </arguments>
</virtualType>
<virtualType name="RemindersGridDataProvider"
             type="Magento\Framework\View\Element\UiComponent\DataProvider\DataProvider">
    <arguments>
        <argument name="collection" xsi:type="object"
                  shared="false">Webinse\Crm\Model\Resource\Reminders\Collection
        </argument>
        <argument name="filterPool" xsi:type="object" shared="false">CrmGirdFilterPool</argument>
    </arguments>
</virtualType>
</config>

ui_component/crm_reminders_listing.xml

<?xml version="1.0" encoding="UTF-8"?>

<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">crm_reminders_listing.crm_reminders_listing_data_source</item>
        <item name="deps" xsi:type="string">crm_reminders_listing.crm_reminders_listing_data_source</item>
    </item>
    <item name="spinner" xsi:type="string">crm_reminders_columns</item>

</argument>
<dataSource name="crm_reminders_listing_data_source">
    <argument name="dataProvider" xsi:type="configurableObject">
        <argument name="class" xsi:type="string">RemindersGridDataProvider</argument>
        <argument name="name" xsi:type="string">crm_reminders_listing_data_source</argument>
        <argument name="primaryFieldName" xsi:type="string">reminder_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>
</argument>
<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">crm_reminders_listing.crm_reminders_listing.listing_top.bookmarks</item>
                <item name="namespace" xsi:type="string">current.paging</item>
            </item>
            <item name="selectProvider" xsi:type="string">crm_reminders_listing.crm_reminders_listing.crm_reminders_columns.ids</item>
            <item name="displayArea" xsi:type="string">bottom</item>
            <item name="options" xsi:type="array">
                <item name="20" xsi:type="array">
                    <item name="value" xsi:type="number">20</item>
                    <item name="label" xsi:type="string" translate="true">20</item>
                </item>
                <item name="30" xsi:type="array">
                    <item name="value" xsi:type="number">30</item>
                    <item name="label" xsi:type="string" translate="true">30</item>
                </item>
                <item name="50" xsi:type="array">
                    <item name="value" xsi:type="number">50</item>
                    <item name="label" xsi:type="string" translate="true">50</item>
                </item>
                <item name="100" xsi:type="array">
                    <item name="value" xsi:type="number">100</item>
                    <item name="label" xsi:type="string" translate="true">100</item>
                </item>
                <item name="200" xsi:type="array">
                    <item name="value" xsi:type="number">200</item>
                    <item name="label" xsi:type="string" translate="true">200</item>
                </item>
            </item>
        </item>
    </argument>
</paging>
</container>

<columns name="crm_reminders_columns">
    <argument name="data" xsi:type="array">
        <item name="config" xsi:type="array">
            <item name="storageConfig" xsi:type="array">
                <item name="provider" xsi:type="string">crm_reminders_listing.crm_reminders_listing.listing_top.bookmarks</item>
                <item name="namespace" xsi:type="string">current</item>
            </item>
            <item name="childDefaults" xsi:type="array">
                <item name="fieldAction" xsi:type="array">
                    <item name="provider" xsi:type="string">crm_reminders_listing.crm_reminders_listing.crm_reminders_columns.actions</item>
                    <item name="target" xsi:type="string">applyAction</item>
                    <item name="params" xsi:type="array">
                        <item name="0" xsi:type="string">edit</item>
                        <item name="1" xsi:type="string">${ $.$data.rowIndex }</item>
                    </item>
                </item>
                <item name="controlVisibility" xsi:type="boolean">true</item>
                <item name="storageConfig" xsi:type="array">
                    <item name="provider" xsi:type="string">crm_reminders_listing.crm_reminders_listing.listing_top.bookmarks</item>
                    <item name="root" xsi:type="string">columns.${ $.index }</item>
                    <item name="namespace" xsi:type="string">current.${ $.storageConfig.root}</item>
                </item>
            </item>
        </item>
    </argument>
    <column name="reminder_id">
        <argument name="data" xsi:type="array">
            <item name="js_config" xsi:type="array">
                <item name="component" xsi:type="string">Magento_Ui/js/grid/columns/column</item>
            </item>
            <item name="config" xsi:type="array">
                <item name="dataType" xsi:type="string">text</item>
                <item name="sorting" xsi:type="string">asc</item>
                <item name="align" xsi:type="string">left</item>
                <item name="label" xsi:type="string" translate="true">ID</item>
            </item>
        </argument>
    </column>
    <column name="full_name" class="Webinse\Crm\Ui\Component\Listing\Column\Reminders">
        <argument name="data" xsi:type="array">
            <item name="js_config" xsi:type="array">
                <item name="component" xsi:type="string">Magento_Ui/js/grid/columns/column</item>
            </item>
            <item name="config" xsi:type="array">
                <item name="dataType" xsi:type="string">text</item>
                <item name="align" xsi:type="string">left</item>
                <item name="label" xsi:type="string" translate="true">Reminder assign to</item>
            </item>
        </argument>
    </column>
    <column name="group_name">
        <argument name="data" xsi:type="array">
            <item name="js_config" xsi:type="array">
                <item name="component" xsi:type="string">Magento_Ui/js/grid/columns/column</item>
            </item>
            <item name="config" xsi:type="array">
                <item name="dataType" xsi:type="string">text</item>
                <item name="align" xsi:type="string">left</item>
                <item name="label" xsi:type="string" translate="true">Reminder assign to</item>
            </item>
        </argument>
    </column>
    <column name="datetime">
        <argument name="data" xsi:type="array">
            <item name="js_config" xsi:type="array">
                <item name="component" xsi:type="string">Magento_Ui/js/grid/columns/date</item>
            </item>
            <item name="config" xsi:type="array">
                <item name="dataType" xsi:type="string">date</item>
                <item name="align" xsi:type="string">left</item>
                <item name="label" xsi:type="string" translate="true">Start Date</item>
            </item>
        </argument>
    </column>
    <column name="duedatetime">
        <argument name="data" xsi:type="array">
            <item name="js_config" xsi:type="array">
                <item name="component" xsi:type="string">Magento_Ui/js/grid/columns/date</item>
            </item>
            <item name="config" xsi:type="array">
                <item name="dataType" xsi:type="string">date</item>
                <item name="align" xsi:type="string">left</item>
                <item name="label" xsi:type="string" translate="true">Due Date</item>
            </item>
        </argument>
    </column>
    <column name="title">
        <argument name="data" xsi:type="array">
            <item name="js_config" xsi:type="array">
                <item name="component" xsi:type="string">Magento_Ui/js/grid/columns/column</item>
            </item>
            <item name="config" xsi:type="array">
                <item name="dataType" xsi:type="string">text</item>
                <item name="align" xsi:type="string">left</item>
                <item name="label" xsi:type="string" translate="true">Note</item>
            </item>
        </argument>
    </column>
    <column name="customer_name">
        <argument name="data" xsi:type="array">
            <item name="js_config" xsi:type="array">
                <item name="component" xsi:type="string">Magento_Ui/js/grid/columns/column</item>
            </item>
            <item name="config" xsi:type="array">
                <item name="dataType" xsi:type="string">text</item>
                <item name="align" xsi:type="string">left</item>
                <item name="label" xsi:type="string" translate="true">Customer Name</item>
            </item>
        </argument>
    </column>
    <column name="email">
        <argument name="data" xsi:type="array">
            <item name="js_config" xsi:type="array">
                <item name="component" xsi:type="string">Magento_Ui/js/grid/columns/column</item>
            </item>
            <item name="config" xsi:type="array">
                <item name="dataType" xsi:type="string">text</item>
                <item name="align" xsi:type="string">left</item>
                <item name="label" xsi:type="string" translate="true">Customer Email</item>
            </item>
        </argument>
    </column>
    <column name="status">
        <argument name="data" xsi:type="array">
            <item name="js_config" xsi:type="array">
                <item name="component" xsi:type="string">Magento_Ui/js/grid/columns/column</item>
            </item>
            <item name="config" xsi:type="array">
                <item name="dataType" xsi:type="string">text</item>
                <item name="align" xsi:type="string">left</item>
                <item name="label" xsi:type="string" translate="true">Status</item>
            </item>
        </argument>
    </column>
    <column name="order_increment_id" class="Webinse\Crm\Ui\Component\Listing\Column\Links">
        <argument name="data" xsi:type="array">
            <item name="config" xsi:type="array">
                <item name="dataType" xsi:type="string">actions</item>
                <item name="align" xsi:type="string">left</item>
                <item name="label" xsi:type="string" translate="true">Reminder for Order, ID</item>
                <item name="data_type" xsi:type="string">actions</item>
                <item name="filterable" xsi:type="boolean">false</item>
                <item name="sortable" xsi:type="boolean">false</item>
            </item>
        </argument>
    </column>
    <column name="customer_id">
        <argument name="data" xsi:type="array">
            <item name="js_config" xsi:type="array">
                <item name="component" xsi:type="string">Magento_Ui/js/grid/columns/column</item>
            </item>
            <item name="config" xsi:type="array">
                <item name="dataType" xsi:type="string">actions</item>
                <item name="align" xsi:type="string">left</item>
                <item name="label" xsi:type="string" translate="true">Reminder for Customer, ID</item>
            </item>
        </argument>
    </column>
    <column name="actions" class="Webinse\Crm\Ui\Component\Listing\Column\RemindersActions">
        <argument name="data" xsi:type="array">
            <item name="config" xsi:type="array">
                <item name="draggable" xsi:type="boolean">false</item>
                <item name="dataType" xsi:type="string">actions</item>
                <item name="indexField" xsi:type="string">reminder_id</item>
                <item name="blockVisibility" xsi:type="boolean">true</item>
                <item name="align" xsi:type="string">left</item>
                <item name="label" xsi:type="string" translate="true">Action</item>
                <item name="data_type" xsi:type="string">actions</item>
                <item name="filterable" xsi:type="boolean">false</item>
                <item name="sortable" xsi:type="boolean">false</item>
            </item>
        </argument>
    </column>
</columns>
</listing>

UPDATE 2:

add layout:

<?xml version="1.0"?>
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
<update handle="styles"/>
<body>
    <referenceContainer name="content">
        <uiComponent name="crm_reminders_listing"/>
        <block class="Webinse\Crm\Block\Adminhtml\Reminders" name="reminders_list"/>
    </referenceContainer>
</body>
</page>
5
  • You can show di.xml file and a xml file in view/adminhtml/ui_component folder
    – LinoPham
    Commented Dec 17, 2015 at 15:42
  • @Bill Added to question.
    – ZebraBeard
    Commented Dec 17, 2015 at 16:05
  • I forgot tell you need upload your layout about ui_component
    – LinoPham
    Commented Dec 17, 2015 at 16:14
  • @Bill Check it please
    – ZebraBeard
    Commented Dec 18, 2015 at 8:30
  • Really, it very complex and longer if i explain for you. Because in new version, Magento 2 change very much about UI, di.xml, ResourceModel.
    – LinoPham
    Commented Dec 18, 2015 at 9:12

1 Answer 1

0

in first look : in mag rc Resource folder is converting to ResourceModel you need update because i see Webinse\Crm\Model\Resource\Reminders\Collection change to Webinse\Crm\Model\ResourceModel\Reminders\Collection

1
  • Create grid in m2 have 2 ways. One is oldschool way like m1. And another use ui_component. My question is how to use event or dispatch if use ui_components. Can we pass it through ui ways
    – mrtuvn
    Commented Jan 18, 2016 at 3:42

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.