All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.github.fluorumlabs.disconnect.vaadin.elements.GridColumnElement Maven / Gradle / Ivy

The newest version!
package com.github.fluorumlabs.disconnect.vaadin.elements;

import com.github.fluorumlabs.disconnect.core.annotations.Import;
import com.github.fluorumlabs.disconnect.core.annotations.NpmPackage;
import com.github.fluorumlabs.disconnect.vaadin.Vaadin;
import com.github.fluorumlabs.disconnect.vaadin.elements.mixins.ColumnBaseMixin;
import com.github.fluorumlabs.disconnect.vaadin.renderers.CellRenderer;
import js.lang.Any;
import js.web.dom.HTMLElement;
import org.teavm.jso.JSProperty;

import javax.annotation.Nullable;

/**
 * A <vaadin-grid-column> is used to configure how a column in <vaadin-grid>
 * should look like.
 * 

* See <vaadin-grid> documentation and demos for instructions and examples on how * to configure the <vaadin-grid-column>. * *

*/ @NpmPackage( name = "@vaadin/vaadin", version = Vaadin.VERSION ) @Import( module = "@vaadin/vaadin-grid/theme/lumo/vaadin-grid-column.js" ) public interface GridColumnElement extends HTMLElement, ColumnBaseMixin { static String TAGNAME() { return "vaadin-grid-column"; } /** * Width of the cells for this column. */ @Nullable @JSProperty String getWidth(); /** * Width of the cells for this column. */ @JSProperty void setWidth(String width); /** * Flex grow ratio for the cell widths. When set to 0, cell width is fixed. */ @JSProperty double getFlexGrow(); /** * Flex grow ratio for the cell widths. When set to 0, cell width is fixed. */ @JSProperty void setFlexGrow(double flexGrow); /** * Custom function for rendering the cell content. * Receives three arguments: * *
    *
  • root The cell content DOM element. Append your content to it.
  • *
  • column The <vaadin-grid-column> element.
  • *
  • rowData The object with the properties related with * the rendered item, contains: *
      *
    • rowData.index The index of the item.
    • *
    • rowData.item The item.
    • *
    • rowData.expanded Sublevel toggle state.
    • *
    • rowData.level Level of the tree represented with a horizontal offset of the toggle button.
    • *
    • rowData.selected Selected state.
    • *
    *
  • *
*/ @Nullable @JSProperty CellRenderer getRenderer(); /** * Custom function for rendering the cell content. * Receives three arguments: * *
    *
  • root The cell content DOM element. Append your content to it.
  • *
  • column The <vaadin-grid-column> element.
  • *
  • rowData The object with the properties related with * the rendered item, contains: *
      *
    • rowData.index The index of the item.
    • *
    • rowData.item The item.
    • *
    • rowData.expanded Sublevel toggle state.
    • *
    • rowData.level Level of the tree represented with a horizontal offset of the toggle button.
    • *
    • rowData.selected Selected state.
    • *
    *
  • *
*/ @JSProperty void setRenderer(CellRenderer renderer); /** * Path to an item sub-property whose value gets displayed in the column body cells. * The property name is also shown in the column header if an explicit header or renderer isn't defined. */ @Nullable @JSProperty String getPath(); /** * Path to an item sub-property whose value gets displayed in the column body cells. * The property name is also shown in the column header if an explicit header or renderer isn't defined. */ @JSProperty void setPath(String path); /** * Automatically sets the width of the column based on the column contents when this is set to true. *

* For performance reasons the column width is calculated automatically only once when the grid items * are rendered for the first time and the calculation only considers the rows which are currently * rendered in DOM (a bit more than what is currently visible). If the grid is scrolled, or the cell * content changes, the column width might not match the contents anymore. *

* Hidden columns are ignored in the calculation and their widths are not automatically updated when * you show a column that was initially hidden. *

* You can manually trigger the auto sizing behavior again by calling grid.recalculateColumnWidths(). *

* The column width may still grow larger when flexGrow is not 0. */ @JSProperty boolean isAutoWidth(); /** * Automatically sets the width of the column based on the column contents when this is set to true. *

* For performance reasons the column width is calculated automatically only once when the grid items * are rendered for the first time and the calculation only considers the rows which are currently * rendered in DOM (a bit more than what is currently visible). If the grid is scrolled, or the cell * content changes, the column width might not match the contents anymore. *

* Hidden columns are ignored in the calculation and their widths are not automatically updated when * you show a column that was initially hidden. *

* You can manually trigger the auto sizing behavior again by calling grid.recalculateColumnWidths(). *

* The column width may still grow larger when flexGrow is not 0. */ @JSProperty void setAutoWidth(boolean autoWidth); }





© 2015 - 2024 Weber Informatics LLC | Privacy Policy