Hi, @olijoseluciano
In the case you can use a combination of declaring the column in the view descriptor and configure custom renderer. The order of columns are defined the order of <column>
tags in the <columns>
tag.
Example with the custom column with the custom renderer, header and fixed width:
View descriptor:
<dataGrid id="usersDataGrid"
width="100%"
columnReorderingAllowed="true"
minHeight="20em"
dataContainer="usersDc">
<columns resizable="true">
<column property="username"/> <!--the first column -->
<column key="fullName" header="Full name" width="5em"/>
<!-- other columns -->
</columns>
</dataGrid>
View controller:
@Supply(to = "usersDataGrid.fullName", subject = "renderer")
protected Renderer<User> usersDataGridFullNameRenderer() {
return new ComponentRenderer<>(user -> {
Span span = new Span();
span.setText(StringUtils.joinWith(" ", user.getFirstName(), user.getLastName()));
return span;
});
}
Regards,
Maria.