Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Scout » Disabling the indicated column header in the table
Disabling the indicated column header in the table [message #1820764] Tue, 28 January 2020 13:32 Go to next message
Krzysztof Leja is currently offline Krzysztof LejaFriend
Messages: 55
Registered: April 2019
Member
Hi,
With the Scout table widget you can perform many functions on columns in a web browser. Some of them can be turned off at the column level and or globally for all columns in the table. My own research of Scout API shows that the possibilities in this area are as follows:

  • Move. Column disabling level: setFixedPosition(true).
  • Sort. Column disabling level: setSortEnabled(false).
  • Group. Column disabling level: ?. Global disabling level: ?.
  • Aggregate. Column disabling level: setAllowedAggregationFunctions(CollectionUtility.hashSet()).
  • Filter. Column disabling level: ?. Global disabling level: ?.
  • Hide/Show. Column disabling level: ?. Global disabling level: ?.
  • Edit. Column disabling level: setEditable(false).
  • Setting background effects. Column disabling level: ?. Global disabling level: ?.


In addition, it is possible to disable all functions globally available after clicking on the column header, using the function ITable.setHeaderEnabled (false).

In my application I often have tables where I would like to disable all options for only indicated columns (e.g. grouping, sorting, filtering). Usually these columns contain only my buttons, that trigger some actions to be performed on a given row in the table (e.g. deletion, editing).

Based on the above analysis, I know how to disable sorting for the indicated column. And how can you disable the other functions?

[Updated on: Wed, 05 February 2020 14:54]

Report message to a moderator

Re: Disabling the indicated column header in the table [message #1820826 is a reply to message #1820764] Wed, 29 January 2020 19:36 Go to previous messageGo to next message
Claudio Guglielmo is currently offline Claudio GuglielmoFriend
Messages: 259
Registered: March 2010
Senior Member
Hi,

You can disable the header menus by using the property headerMenusEnabled on the table or headerMenuEnabled on a specific column. Compared to disabling the header completely using headerEnabled it has the advantage that sorting, moving or resizing the columns is still possible.

Only disabling some actions of the menu is possible to a certain degree. With the column property fixedPosition, you can disable the move buttons. With the table property sortEnabled, you can disable the sort buttons (uiSortPossible actually serves another purpose and does not disable the sort buttons).

The edit button is controlled by the column property modifiable (editable makes the cells editable so you can change theirs value directly and won't change the visibility of the button). The remove button is controlled by the column property removable. The add button is controlled by the table property columnAddable.

I am not sure which properties are available from the Java code. If it is an official property there should be a getConfigured* method on the table or column, just watch out for these.

For the other buttons you could also try to hide them using CSS but then it would affect all tables unless you could add a CSS class to a specific header menu which would require some Java Script code.

Btw: In addition to the Scout Classic Widgets app you already know, you should also have a look at the Scout JS Widgets app:
https://scout.bsi-software.com/jswidgets/#table. The widgets are the same but the Scout JS widgets app may show some more properties you won't find in the classic widgets app.

Have fun
Claudio

Re: Disabling the indicated column header in the table [message #1820854 is a reply to message #1820826] Thu, 30 January 2020 13:00 Go to previous message
Krzysztof Leja is currently offline Krzysztof LejaFriend
Messages: 55
Registered: April 2019
Member
Hi Claudio,
Quote:

You can disable the header menus by using the property headerMenusEnabled on the table or headerMenuEnabled on a specific column. Compared to disabling the header completely using headerEnabled it has the advantage that sorting, moving or resizing the columns is still possible.


I use clasic Scout Framework, not Scout JS, that's why I'm looking for solutions provided by the Java model.

Quote:

With the column property fixedPosition, you can disable the move buttons.


Thanks! I checked that the above maps to AbstractColumn.getConfiguredFixedPosition(). I updated my function list from the first post in this respect.

Quote:

With the table property sortEnabled, you can disable the sort buttons (uiSortPossible actually serves another purpose and does not disable the sort buttons).


OK, this solves my sorting hiding problem.

Quote:

The edit button is controlled by the column property modifiable (editable makes the cells editable so you can change theirs value directly and won't change the visibility of the button).


On the Java model side, I found only a function AbstractTable. getTableOrganizer().isColumnModifiable(IColumn column) that probably checks the flag you mentioned, but I haven't found a function to change this flag.

Quote:

The remove button is controlled by the column property removable. The add button is controlled by the table property columnAddable.


Same as above: I found only a function AbstractTable. getTableOrganizer().isColumnRemovable(IColumn column) that probably checks the flag you mentioned, but I haven't found a function to change this flag.

Quote:

I am not sure which properties are available from the Java code. If it is an official property there should be a getConfigured* method on the table or column, just watch out for these.


OK, once again I will analyze all the functions available in the AbstractTable class and maybe I will find something new.

Quote:

Btw: In addition to the Scout Classic Widgets app you already know, you should also have a look at the Scout JS Widgets app:
https://scout.bsi-software.com/jswidgets/#table. The widgets are the same but the Scout JS widgets app may show some more properties you won't find in the classic widgets app.


Thanks for the tip. I haven't analyzed Scout JS before.
Previous Topic:calling the web service directly from the client module
Next Topic:Uploading all files in a directory tree in Scout 9
Goto Forum:
  


Current Time: Sat Sep 21 01:22:03 GMT 2024

Powered by FUDForum. Page generated in 0.03693 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top