Skip to content

Commit

Permalink
Fix problem with sorting and filtering on reservation grid (#49)
Browse files Browse the repository at this point in the history
  • Loading branch information
mstrzyzewski authored Apr 21, 2020
1 parent 0b4fdcf commit 7f837f9
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
9 changes: 9 additions & 0 deletions Model/ResourceModel/Reservation/Collection/Grid.php
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,15 @@ protected function _beforeLoad()
return parent::_beforeLoad();
}

protected function _initSelect()
{
$this
->addFilterToMap("reservation_id", "main_table.reservation_id")
->addFilterToMap("sku", "main_table.sku");

return parent::_initSelect();
}

/**
*
*/
Expand Down
6 changes: 2 additions & 4 deletions view/adminhtml/ui_component/allegro_reservations_listing.xml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@
</item>
</argument>
<bookmark name="bookmarks"/>
<filterSearch name="fulltext"/>
<filters name="listing_filters" />
<paging name="listing_paging"/>
<exportButton name="export_button"/>
Expand All @@ -39,6 +38,7 @@
<column name="entity_id" sortOrder="10">
<argument name="data" xsi:type="array">
<item name="config" xsi:type="array">
<item name="filter" xsi:type="string">textRange</item>
<item name="sorting" xsi:type="string">asc</item>
<item name="label" xsi:type="string" translate="true">ID</item>
</item>
Expand All @@ -47,6 +47,7 @@
<column name="reservation_id" sortOrder="20">
<argument name="data" xsi:type="array">
<item name="config" xsi:type="array">
<item name="filter" xsi:type="string">textRange</item>
<item name="sorting" xsi:type="string">asc</item>
<item name="label" xsi:type="string" translate="true">Reservation ID</item>
</item>
Expand All @@ -56,7 +57,6 @@
<argument name="data" xsi:type="array">
<item name="config" xsi:type="array">
<item name="filter" xsi:type="string">text</item>
<item name="sorting" xsi:type="string">asc</item>
<item name="label" xsi:type="string" translate="true">Checkout form ID</item>
</item>
</argument>
Expand All @@ -65,15 +65,13 @@
<argument name="data" xsi:type="array">
<item name="config" xsi:type="array">
<item name="filter" xsi:type="string">text</item>
<item name="sorting" xsi:type="string">asc</item>
<item name="label" xsi:type="string" translate="true">Product SKU</item>
</item>
</argument>
</column>
<column name="quantity" sortOrder="50">
<argument name="data" xsi:type="array">
<item name="config" xsi:type="array">
<item name="sorting" xsi:type="string">asc</item>
<item name="label" xsi:type="string" translate="true">Quantity</item>
</item>
</argument>
Expand Down

0 comments on commit 7f837f9

Please sign in to comment.