Skip to content

Update ViewAction.php #6742

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 2 commits into from
Closed

Update ViewAction.php #6742

wants to merge 2 commits into from

Conversation

vrgfa
Copy link

@vrgfa vrgfa commented Sep 25, 2016

In flles
magento/module-sales/view/adminhtml/ui_component/sales_order_view_creditmemo_grid.xml
magento/module-sales/view/adminhtml/ui_component/sales_order_view_invoice_grid.xml
magento/module-sales/view/adminhtml/ui_component/sales_order_view_shipment_grid.xml

the following snippet is used:

<actionsColumn name="actions" class="Magento\Sales\Ui\Component\Listing\Column\ViewAction">
     <argument name="data" xsi:type="array">
         <item name="config" xsi:type="array">
             <item name="indexField" xsi:type="string">entity_id</item>
             <item name="viewUrlPath" xsi:type="string">sales/order_creditmemo/view</item>
             <item name="urlEntityParamName" xsi:type="string">creditmemo_id</item>
         </item>
     </argument>
 </actionsColumn>```


however, unlike "viewUrlPath" and  "urlEntityParamName"  the item named "indexField" is not implemented in the code of Magento\Sales\Ui\Component\Listing\Column\ViewAction

It is needed when adding a custom table the same way as credmemo, invoice and shipment grids with a an index field other than "entity_id"

In flles 
magento/module-sales/view/adminhtml/ui_component/sales_order_view_creditmemo_grid.xml
magento/module-sales/view/adminhtml/ui_component/sales_order_view_invoice_grid.xml
magento/module-sales/view/adminhtml/ui_component/sales_order_view_shipment_grid.xml

the following snippet is used:
        <actionsColumn name="actions" class="Magento\Sales\Ui\Component\Listing\Column\ViewAction">
            <argument name="data" xsi:type="array">
                <item name="config" xsi:type="array">
                    <item name="indexField" xsi:type="string">entity_id</item>
                    <item name="viewUrlPath" xsi:type="string">sales/order_creditmemo/view</item>
                    <item name="urlEntityParamName" xsi:type="string">creditmemo_id</item>
                </item>
            </argument>
        </actionsColumn>

however, unlike "viewUrlPath" and  "urlEntityParamName"  the item named "indexField" is not implemented in the code of Magento\Sales\Ui\Component\Listing\Column\ViewAction

It is needed when adding a custom table the same way as credmemo, invoice and shipment grids with a an index field other than "entity_id"
@magento-cicd2
Copy link
Contributor

magento-cicd2 commented Sep 25, 2016

CLA assistant check
All committers have signed the CLA.

@orlangur orlangur self-assigned this May 17, 2017
@orlangur orlangur added this to the May 2017 milestone May 17, 2017
$viewUrlPath = $this->getData('config/viewUrlPath') ?: '#';
$urlEntityParamName = $this->getData('config/urlEntityParamName') ?: 'entity_id';
$item[$this->getData('name')] = [
'view' => [
'href' => $this->urlBuilder->getUrl(
$viewUrlPath,
[
$urlEntityParamName => $item['entity_id']
$urlEntityParamName => $item[$indexField]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why need such flexibility? Please provide a valid use case.

@orlangur
Copy link
Contributor

orlangur commented Jun 6, 2017

Closing for now due to no response from author.

@orlangur orlangur closed this Jun 6, 2017
mmansoor-magento pushed a commit that referenced this pull request Aug 10, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants