How to remove the sort indicator in GtkTreeViewColumn keeping the column sortable? - gtk

I know it's a bug that is considered not an issue but when you have many columns that you still want them sortable, all displayed without the need to scroll right and left and the sort arrow indicator is not so important. What are available workarounds?

I found it can be done by not applying set_sort_column_id to the treeview column. We must do it programatically through using set_clickable method to the the column that you don't want an arrow to be displayed in its header, then using signal_connect to the clicked signal and bind it to a function which will use get_sort_column_id of the model to get the current sort order whether GTK_SORT_ASCENDING or GTK_SORT_DESCENDING then apply the reverse sort order using set_sort_column_id on the model.

Related

Vega add static field to data

I'm aiming to create a data table with specific color for each line in vega.
Actually i manage to do it like that
My problem is : when I click on a rectangle, it change the color of all the rectangle not only the one I clicked on.
I did not found a way to make my signals values dependent on each of my row so i decided to add a data to each row. At first i tried to use an aggregation but none of the aggregation i found allow me to set a static value in a field.
Then i thought a calculate could do it but it results in a Property calculate is not allowed
Right now I'm stuck and I don't know at all how i could do so.
If anyone has an idea on how I could do it, I would really appreciate. Thanks by advance

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)

What ExtJS 4.2 standard function gets executed for grid selection when using Ext.selection.RowModel (default) selModel?

There is a bug with the way the Ext.grid.Panel rowexpander plugin works when a nested grid is set to renderTo to the rowexpander div id.
When this is implemented, it's difficult to see what is actually being selected. The reason for this is because the config "disableSelection" and "trackMouseOver" are to be both considered for highlighting. I have to set "trackMouseOver: false" so that hovering over grid rows doesn't interfere with reproducing this behavior. Then "disableSelection: false" must be set so that this selection issue does actually occur.
The issue is that when you select index 1 of the nested grid of parent grid index 0 row, index 1 row of parent grid is selected as well. If you select index 2 of the nested grid of parent grid index 0 row, index 2 of parent grid is selected as well.
When 935424 is selected, 815138 is selected since they are both index 0.
When 1056257 is selected, 1013525 is selected since they are both index 1.
When 1200191 is selected, 1261631 is selected since they are both index 2.
I'm suspecting that the selection model instance might be getting shared with the grid and nested grids since I'm using the same definition. They are of course different instances of the same definition, but I'm not sure how the framework handles additional grids using Ext.create?
I'd like to ask how to fix it or get me close, I'll be up-voting you (often). But if you can at least give me a clue as to where this selection function is being called in the framework, that will get me on the right track and can debug and discover a fix for it. I've read that events can bubble, and maybe that's what's happening here. It seems to have a handle on the row as well, because when I double click the nested grid row, it not only tries to expand that row, but also the row from the parent grid row (that matches the row index).
After any recursive nested grid is created, I had to call this line so the click and dblclick (and others) events don't bubble/propagate to the parent grid.
grid[cnt].getEl().swallowEvent(['mouseover', 'mousedown', 'click', 'dblclick', 'onRowFocus']);
How did you load the selection model ?
selModel: 'rowselection',
Or
selModel: Ext.create('Ext.selection.RowModel'),
If you use the first syntax, you should get an independent selection model for each grid. If you use the second syntax, you get only one selection model that is shared among all grid instances.

GWT: get backing object for row by id in table

Is there any simple way to get the object, used to render given row in CellTable, by index of the row?
I am using AsyncDataProvider, and don't want to remember lists of data objects, returned from the server. Also I am using MultiSelectionModel, so several items could be selected there and I need to track out which one was clicked last.
I know the index of last clicked row, so I need to get the object, corresponding to the row, somehow.
getVisibleItem? possibly combined with getPageStart if you're using paging and you only know the absolute index.
For your use-case, maybe you could use a customized selection model whose setSelected tracks the last change.