ag-grid get filtered rows - ag-grid

I've got a grid with a filter applied to it.
I have a button which selects all of the rows in the grid and performs some action. I want to retrieve the filtered rows in this method. How is this possible?
I've come across this previous question however this requires using a filterChanged event to maintain a copy of the filtered rows. I do not want to do this, I would prefer to just query the grid directly for the filtered rows.

gridApi.getModel();
This will Return the row model inside the table. From here you can see the original rows, rows after the filter has been applied, rows after aggregation have been applied, and the final set of 'to be displayed' rows.

Related

How to collect all the id values for a yadcf filtered table

I'm using datatables and yadcf to filter a table. Now I'd like to take all the table row id values, for example, and use those as arguments in a POST request. How can I "collect" the values of these ids from the result of the filters that have been applied? I've seen this example, which doesn't seem to apply to yadcf, but is similar to my use-case.
I was able to get the information I wanted using the answer found here. I didn't realize that jQuery will select only the visible elements, which is what I want. So, after applying the yadcf filter to my table it's simple to select all the tr.id values resulting from the filter.
Yes, the submit content is only the visible row with datatables.
If you have 5 rows and after filter 2 rows, if you click on submit button with the active filter only 2 rows will be submitted.
And if, conversely, you still wanted to submit all the elements of the table despite the filtering, on the onsubmit there is a yadcf function that you just have to execute which deactivates all active filtering to submit the entire table like this :
var table = $('#mytable').DataTable( {}) ;
document.onsubmit = function(){
yadcf.exResetAllFilters(table) ;
};

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

sap.m.Table removeColumn does not delete the corresponding items

If I remove one Column using a sap.m.Table from a standard view the corresponding items are still available. The problem here is that the ordering is wrong after I delete a column here.
Lets say I want to delete the "Historie"-Column, the corresponding items are still available. How can I delete one column with the items of one column here?
The problem here looks like that:
As you can see in the picture below I have deleted some columns and also the "Historie"-Column. The corresponding items are still available.
How to solve this and delete the matching items here using sap.m.Table?
I tried to remove the Columns by removeColumn(oCol) from the API: sap.m.Table
I think this is a bug with sap.m.Table.
For your problem, you can use the visible property of column to hide the column from view. Though it will not remove the column from the table.
var oTable = this.byId('idTable');
var oDeleteColumn = oTable.getColumns()[0]; //fetch the column you want to hide
oDeleteColumn.setVisible(false);
removeColumn() removes the column only from the table's <column> aggregation, but not from the data.
If it is an option for you, than use Table Personalization:
Table personalization can be used to modify the display and settings
of a table.
It is a UI pattern that is used to change one or more of the following
attributes:
Visibility of columns
Order of columns
Sorting
Grouping
Filtering
Sample

How to get list of rows of selected sheet in Smartsheet using REST?

I'm trying to get list of rows of selected sheet. I went for REST API for rows List of row's related calls but didn't get any resource to get list of rows.
How can I get list of rows? or the REST call have not been written yet.
You can get a list of rows by using the Get Sheet operation. The response will contain the list of rows in the sheet, the list of columns in the sheet (which you'll need to interpret the cells data within the rows collection), along with sheet-level properties and any other data you've requested by using the include parameter.

How to programmatically create ListView based off SQLite query?

I have some code that allows the user to perform a search by selecting a few checkboxes. A sql query is then created based on what checkboxes are checked. (Up to 5 checkboxes)
The data is then queried against a sqlite data.
The issue is now how do i populate the data into a listview (not knowing how many columns there will be ahead of time (Could be anywhere from 1 to 5)
All the examples I"ve seen is where the listView is created and you know exactly how many colummns are going to be returned.
A previous posted suggested to query all the records and then use if statements to determine if the value is null then hide column.