Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>In addition to what Thomas said you can look into <a href="https://github.com/gwtbootstrap/gwt-bootstrap" rel="nofollow">gwt-bootstrap</a>. They have a custom <a href="http://gwtbootstrap.github.io/gwt-bootstrap/apidocs/com/github/gwtbootstrap/client/ui/DataGrid.html" rel="nofollow">DataGrid</a> widget that can be shown or hidden based on breakpoints (tablets, phones, etc).<br> If you actually want to hide and show columns based on available size you extend the <code>DataGrid</code> and do something along this lines:</p> <pre><code>ResponsiveDataGrid extends DataGrid&lt;myDTO&gt; { private final Column&lt;myDTO,String&gt; column1; private final Column&lt;myDTO,String&gt; column2; private Boolean isCompact; public ResponsiveDataGrid(int pageSize, Resources resources,ActionCell.Delegate&lt;myDTO&gt; actionDelegate) { super(pageSize, resources,new EntityProxyKeyProvider&lt;myDTO&gt;()); initColumns(); } private void initColumns() { // init your columns } private void updateColumns() { int columnCount = getColumnCount(); for (int i =columnCount-1;i&gt;=0;i--) { removeColumn(i); } removeUnusedColGroups(); if (isCompact) { // show columns for compact size } else { // show all columns } } @Override protected int getRealColumnCount() { return getColumnCount(); } // WORKAROUND for some sizing issues in DataGrid private void removeUnusedColGroups() { int columnCount = getColumnCount(); NodeList&lt;Element&gt; colGroups = getElement().getElementsByTagName("colgroup"); for (int i = 0; i &lt; colGroups.getLength(); i++) { Element colGroupEle = colGroups.getItem(i); NodeList&lt;Element&gt; colList = colGroupEle.getElementsByTagName("col"); for (int j = colList.getLength()-1;j&gt;=0; j--) { colGroupEle.removeChild(colList.getItem(j)); } } } @Override public void onResize() { super.onResize(); if (!isAttached()) { return; } // or whatever breakpoint you want to support boolean isNewCompact = (getOffsetWidth() &lt; 800); if (isCompact == null || isNewCompact != isCompact) { isCompact = isNewCompact; updateColumns(); } } } </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload