Class EditorRenderer<T>
java.lang.Object
com.vaadin.flow.data.renderer.Renderer<T>
com.vaadin.flow.component.grid.editor.EditorRenderer<T>
- Type Parameters:
T
- the type of the object being processed
- All Implemented Interfaces:
DataGenerator<T>
,Serializable
Renderer and DataGenerator used by
Grid.Column
to control the state of the
editor components.
Components are created during the generateData(Object, JsonObject)
calls, and the proper data is sent to the client-side to be rendered.
- Author:
- Vaadin Ltd.
- See Also:
-
Constructor Summary
ConstructorDescriptionEditorRenderer
(Editor<T> editor, String columnInternalId) Creates a new renderer for a specific column. -
Method Summary
Modifier and TypeMethodDescriptionvoid
generateData
(T item, elemental.json.JsonObject jsonObject) Adds custom data for the given item to its serializedJsonObject
representation.void
refreshData
(T item) Informs theDataGenerator
that a data object has been updated.render
(Element container, DataKeyMapper<T> keyMapper, String rendererName) Registers a renderer function with the given name to the given container element.void
setComponentFunction
(SerializableFunction<T, ? extends Component> componentFunction) Sets the function that creates components to be used as editors for the column.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface com.vaadin.flow.data.provider.DataGenerator
destroyAllData, destroyData
-
Constructor Details
-
EditorRenderer
Creates a new renderer for a specific column.- Parameters:
editor
- the Grid's editorcolumnInternalId
- the internal Id of the column that uses this data generator
-
-
Method Details
-
setComponentFunction
Sets the function that creates components to be used as editors for the column. When set tonull
, an empty component is used instead.- Parameters:
componentFunction
- the function that generates editor components
-
generateData
Description copied from interface:DataGenerator
Adds custom data for the given item to its serializedJsonObject
representation. This JSON object will be sent to client-side DataProvider.- Specified by:
generateData
in interfaceDataGenerator<T>
- Parameters:
item
- the data item being serializedjsonObject
- the JSON object being sent to the client
-
refreshData
Description copied from interface:DataGenerator
Informs theDataGenerator
that a data object has been updated. This method should update any unneeded information stored for given item.- Specified by:
refreshData
in interfaceDataGenerator<T>
- Parameters:
item
- the updated item
-
render
Description copied from class:Renderer
Registers a renderer function with the given name to the given container element. Creates the setup to handle rendering of individual data items as requested by the renderer function invocation.- Specified by:
render
in classRenderer<T>
- Parameters:
container
- the element which accepts the renderer function on the client.keyMapper
- mapper used internally to fetch items by key and to provide keys for given items.rendererName
- name of the renderer function the container element accepts- Returns:
- the context of the rendering, that can be used by the components to provide extra customization
-