Where are stored filter params in magento 2? - magento2

I need to export the products catalog after I applied a filter. I made a custom button for this, but in the query I need the filters already applied on the grid. Is it possible to get them from the global variable? I noticed that if I refresh the page, the filters are kept, but I do not know where they are from.

You can find applied filters data at the ui_bookmark table of your database;
SELECT `namespace`, `config` FROM `ui_bookmark`;

Related

How to relate a column to the row rather than the other way in anylogic

I have created a database in anylogic. Previously, I have related the information in the row to the columnn, i.e. there is a component in the row, and its properties are in the columns, and have put this in a function. Now I want to make the component the column and the properties, but don't know how to make it all relate. Below is the code I've written for the former:
site = selectFrom(parameters) .where(parameters.box_number.eq(boxNumber)) .where(parameters.site.eq(site)) .firstResult(parameters.site);
So box_number is the component and site is one of the properties. With this method, site is a column, but I want it to be a row.
You should use the SELECT WHERE SQL syntax, see https://help.anylogic.com/index.jsp?topic=%2Fcom.anylogic.help%2Fhtml%2Fconnectivity%2Fquerying.html&resultof=%22%73%65%6c%65%63%74%22%20%22%77%68%65%72%65%22%20
You can filter and load data in any format. Also, best use the database query wizard to help:

How to create queries dynamically based on filters selected in PostgreSQL?

I have a UI where products of various categories will be listed. There will be filters on various attributes which users can select to filter out the products. How should I create a query which will change dynamically based on the selection of filters? Further, once the result set is ready, only few rows to be displayed at a time to the user e.g. 10 rows at a time; value of which again will be decided by the user.
You could write a PL/pgSQL function that takes a JSON with filter fields and values and returns matching rows. But there are libraries for doing that, why not use one of them. What is your UI built on?
On pagination, see Five ways to paginate in Postgres

Filtering a datasource using multi select wild character

Does anyone know if there is a wildcard character in AppMaker that can be used for all possible values for a field in a query?
I currently have a datasource that is being filtered based on the status using a multi-select widget. What I would like to accomplish is when all values have been de-selected I want to load all the records of that datasource without clearing the entire query in case other filters have been applied. I have it working in-a-sense that I have to explicitly construct my query as such:
widget.datasource.query.filters.Status._in = ['Status Value 1','Status Value 2','Status Value 3']
My current solution is loading the correct data when a value is selected and it correctly shows the union of the query as the values are modified. However, it selects all of the values in my multi-select; which I know is how it is supposed to work.
I tried using widget.datasource.query.filters.Status._contains = ''; and changing the assignment value to no avail. I even tried the opposite approach using _notContains
The intended outcome is to have a filtering dashboard appear much like any website where when no filtering is selected all records are displayed. I was hoping to find a wildcard character that would load all of the records. Just trying to find a way to mimic other website filters with all records when none are selected.
Thanks for the time!
So the easiest solution here is to set up your Multiselect as follows:
Options binding:
#models.YourModel.fields.Status.possibleValues
or if you don't have the possible Status values in your model then set your options binding to:
['Status Value 1','Status Value 2','Status Value 3']
Values binding:
#datasource.query.filters.Status._in
Now anytime you select any choices in the multiselect, the query will only include records that include the selected choices. And if you deselect all choices the query will ignore that filter or treat it as an empty array of values, therefore returning all records unless you applied other filters.

SAPUI5 Filter Search

I'm Developing Fiori App with Master-Master-Detail template,
First I'm filtering by date but I want to use the search box that it's generated by default.
I need to use both condition filters: Date and the element specified in serach box.
Somebody knows how to add search filter without remove previous filter?
The filters are applied to the ListBinding and there is no official API to access to current filter objects. You could store the filters somewhere in your controller, but eventually, you'll need to call the filter method again with all the filters that you want to apply.

GWT DataGrid/CellTable: Select all over multiple pages

I´m using GWT 2.4 with a DataGrid and a SimplePager along with a MultiSelectionModel. I want to implement a simple select-all-feature over all pages.
I´m only able to select all visible items on the current page. What is the best way to select all items on all pages?
I know the MultiSelectionModel stores the proxy keys provided by a ProvidesKey object in a HashMap. I think I have to request all proxy objects from server or at least all keys. But actually I don´t want to store information about the ProvidesKey´s getKey()-method on server-side. But I also can not access the MultiSelectionModel´s HashMap of the selected proxies´ keys. This all looks cumbersome, so is there a better way to solve this?
As mentioned in https://developers.google.com/web-toolkit/doc/latest/DevGuideUiCellWidgets#selection, one way to achieve this would be to implement your own SelectionModel (e.g. by extending AbstractSelectionModel or DefaultSelectionModel):
A complex implementation can handle "select all" across multiple pages using a boolean to indicate that everything is selected, and then keep track of negative selections.
Why do you need all keys for select all? When you select some objects from a list, you need to remember which ones are selected, but when you select all objects, you need a single Boolean:
// on click Select All button/checkbox
boolean selectAll = true;
// ask a user what he wants to do
// send a request to server with a parameter selectAll to update/delete all objects
Select all across multiple pages will work only if you are NOT lazy loading. First of all why do you need to select all? If you want to do some actions on all the grid data, you will already have the list and you can perform your actions on the list directly. Nonetheless you can select all the rows of the grid over multiple pages by iterating through the list and using the following API on each item.
public void setSelected(T item, boolean selected);
Note: This will work only if you are NOT lazy loading.