javaxmlgwtgwt-material-design

GWT Material. Add InlineSearch in table header


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"/>

Solution

  • 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