How can I delete a row in ag-grid while using InfiniteRowModel? - ag-grid

I'm trying to remove rows from my ag-grid dynamically. My grid currently uses rowModelType: "infinite". I've been using the updateRowData function for adding and updating, but when I try to remove a row using this function:
deleteRow(record) {
this.agGrid.api.updateRowData({ remove: [record] });
}
I get the following warning in my console:
ag-grid: updateRowData for InfiniteRowModel does not support remove or update, only add
I've used it for both add and update and it's been working. How can I delete rows while using an infinite row model?

While working with InfiniteRowModel or ServerSideRowModel, ag-grid doesn't support deleting or updating the records.
It suggests us to gridApi.purgeServerSideCache().
I researched a bit myself regarding accessing the row data in these row model, but it doesn't provide access to it. So better to purge.

Related

MUI DataGrid ColumnDef: the row is not available on the valueOptions prop of the column definition

I am using a DataGridPro component with different columns.
One one the columns is defined like this:
This issue is that I am trying to understand why the row is not available in the valueOptions prop of the column definition.
I would like to be able to populate the choices based on a list that is available on the row in another field.
But I get this error when I try to read the row:
Can you please help? The grid is populated with lots of rows coming from an api fetch.
Every other column is working fine accept this one.
Thank you.
I discovered that it was my bad. My column object was used twice with different parameters and so, yes, the row was not available for the second case.

how to persist filter in ag-grid vuejs

How to persist the filter in ag-grid vuejs . I'm trying to apply filter but when I click on a row for looking the data inside the row node the filter selection is removed I meant the grid load from the starting (reset filter). how to persist this filter.
second problem and I'm facing one more problem is that the selection of row is not working in a long time ... I have applied checkbox in the header but when I select the checkbox after a couple of seconds it will automatically deselect ..so my second question is how to apply checkbox the will not deselect automatically. one particular node check box is not working also
thanks in advance I'm new in this technology please help me out from core ...
I guess for the first problem of yours you should set newRowsAction to 'keep' like this.
{field: 'year', filter: 'number', filterParams: {newRowsAction: 'keep'}}
This property is for when using the Client Side Row Model only. When set to 'clear', updating the data in the grid by calling api.setRowData() (or updating the rowData property if bound by a framework) will clear (reset) the filter. If you instead set this to 'keep', the grid will keep its currently set filter when the data is updated.
Default: 'clear'
for the second problem of your its really hard to interpret based on words so it will be good if you can create minimum code working demo(reproducing the error) on plunkr or stackblitz so that we can help you.

ag-grid v19 filters are not retained

We were using ag-Grid v9. We updated to ag-Grid v19.
We have a drop down in which multiple categories are loaded, we can select one category at a time and its data is loaded in the ag-Grid.
We apply column filters for a selected category and respective rows get filtered. However when we change the category the applied filters are not retained.
Earlier with v9 it was working correctly
Earlier we were using OnAfterFilterChanged() but with v19 it got deprecated so we are using onFilterChanged()
To retain the state of grid filters, sort etc we should update data rather than replace data.
Use the grid property deltaRowDataMode=true
Very nicely explained in the article DataUpdate

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 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.