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

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

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.

Join filter panels as one

Need to add Filter panels as a vizualation and combine it as one
Just drag and drop fields together. Remember that auto suggester can set chart in such a scenario just change to Table. In table you can make selections of all fields together,

AG-Grid: Add and remove columns in column groups while maintaining the state of other columns

I have a table built with AG Grid which needs to display different columns depending on the type of data we give it. This is proving slightly difficult, as I can't find a proper interface in AG Grid which allows you setup new columns in existing column groups, and without blowing up user-driven changes (hidden columns, resizing, pinning, etc).
The biggest issue is that I can't figure out how to access column group definitions.
gridOptions.api.getAllColumns()
This function from aggrid does not directly provide column groups, just the child columns. Looping through the columns via this function, they have a parent property, but that does not include the coldef for the column group, which means there isn't even really a way to reconstruct the coldef based on the data you get from it (also, the parent property is private in typescript).
Here is a rough plunker, modified from one of the ag grid documentation examples which illustrates it
https://plnkr.co/edit/C8TrwlkFDg5O5V1RJkng?p=preview
I did try having all the columns present in the table at all times, and hiding them programmatically based on the incoming data, however that creates several issues with the default column show/hide functionality (you can manually show the invalid columns). Using the initial coldefs won't work too well either, since that will discard any modifications the user has made to the columns.
Is there anyone out there who can point me in the right direction?

How to implement new item of sap.m.Table in Fiori?

I want to implement new item(row) in sap.m.Table. In Add Items section of Fiori guideline, it looks like this:
Here is my Demo
I have three questions:
How to add the new row to the first item of the table?
How to "highlighted it with a visual indicator"? (the left blue part in design)
Why addOneRow function did not work before setModel? Is it because data binding refresh the table or sth.?
1- The way I addressed this problem in several project is by using 2 tables : first tables only contains one fixed row and the second one is binded to an array. When clicking the 'add' button in the first table it resets the first table content and adds an item to the second table binding
2- the hightlight property is on the items. example:
<ColumnListItem type="Detail" highlight="Error">
if you use my solution from #1 you might use it only on first table
3- you're totally right, this is also why you should put your 'addOneRow' in the 'onAfterRendering' callback to make sure your last row (that you likely always want) is always displayed.
(btw if you use solution from #1 you simply dont need it anymore)

Have a jcombobox filter a jtable

following this tutorial http://www.netbeans.org/kb/docs/java/gui-db-custom.html#enhancements
it shows how to use a textbox to filter out the master table. Could anyone instruct me on how to do a similiar thing but use a dropdown to test against a specific column?
(ie a dropdown of countries, to filter by the country column?
thanks
depending on what the source is for the dropdown.
i assume the dropdown isn't used as part of the Jtable itself, but merely shows a list of unique data coming from one column of data?
in that case, you could get the Jtable's datamodel, and then walk through all the cells in the particular column, putting them in a hashmap with the string as the key. that way you have a list of (unfiltered) unique strings to use as the datamodel for the dropdownbox.
You could attach a model listener to the talbedatamodel to know when your list has to be updated as well.