GWT Material. Add InlineSearch in table header

126 Views Asked by At

How can i add this search icon

<m:MaterialLink iconType="SEARCH" ui:field="openSearch" iconColor="BLACK" float="RIGHT"/>

and this Inline search

<incubator:search.ExpandableInlineSearch ui:field="txtSearch" theme="LIGHT" width="50%" placeholder="Search" display="INLINE"/>

in header of material table?

<mt:MaterialDataTable addStyleNames="{style.text-wrap}" ui:field="table"
                                           height="calc(100vh - 151px)"
                                           useStickyHeader="false"
                                           useCategories="false"
                                           useRowExpansion="false"
                                           selectionType="NONE"/>
1

There are 1 best solutions below

0
On BEST ANSWER

Yeah, finally! That was so easy.

You should use this:

@UiField
MaterialDataTable<MailNotificationDTO> table;

Panel panel = table.getScaffolding().getToolPanel();
panel.add(new MaterialIcon(IconType.SEARCH));'

And the same for inline search