Skip to main content

Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » scout » Table Menubar at top
Table Menubar at top [message #1797976] Fri, 09 November 2018 12:27 Go to next message
Miloslav Frajdl is currently offline Miloslav FrajdlFriend
Messages: 17
Registered: June 2018
Junior Member

I have question: Table menubar is rendered at bottom table by default. Can you render this menubar at top (before column headers)?

I don't mean

Thank you for the response.
Re: Table Menubar at top [message #1798067 is a reply to message #1797976] Mon, 12 November 2018 07:51 Go to previous message
Beat Schwarzentrub is currently offline Beat SchwarzentrubFriend
Messages: 131
Registered: November 2010
Senior Member
Miloslav Frajdl wrote on Fri, 09 November 2018 07:27
I have question: Table menubar is rendered at bottom table by default. Can you render this menubar at top (before column headers)?

Yes, but not easily. As you may have noticed, the menubar can be at the top of a table, specifically at the desktop tables (table pages). Tables inside table fields on a form are rendered differently, e.g. they have smaller row height, lighter selection border - and the menubar is always drawn at the bottom.

The position can be controlled with the property "position", by calling the method top() or bottom() on the menubar object. (see default in Table.js) This is only possible in JavaScript, because the menu bar does not exist as a model object in Scout Classic. Are you using Scout Classic (with Java UI Server) or Scout JS (JavaScript only)? Basically you have to call after the table widget is initialized. How this is achieved best depends on whether you want this behavior for all tables or just one specific instance, and if you are using Scout Classic or Scout JS.

Classic, all tables:
Create your own widget class MyTable.js/MyTableAdapter.js that extend from scout.Table/scout.TableAdapter and register it in the object factory. This tells Scout to use MyTable.js to create new instances of "Table" widgets.
scout.objectFactories = $.extend(scout.objectFactories, {
  'Table': function() {
    return new mynamespace.MyTable();

You can then override the _init() method and change the menubar position (don't forget the "super" calls).

Classic, single table:
Add the @ModelVariant("mynamespace.My") annotation to your Table class. This causes mynamespace.MyTable to be used for that specific widget.

ScoutJS, all tables:
Like classic, but the Adapter.js class is not needed.

ScoutJS, single table:
When creating the widget, pass your class name instead of "Table": scout.create('mynamespace.MyTable', ...)

Previous Topic:Error on the start of the simple project
Next Topic:Some questions on hierarchical editable TablePage
Goto Forum:

Current Time: Wed Aug 05 13:58:47 GMT 2020

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

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

Back to the top