I’m not sure how manually modifying the .jar file would be helpful.
The GitHub issue you linked mentions a way of achieving this through Renderers - would you happen know of any examples? I am using the pure Java (vaadin-grid-flow) version of Vaadin, so I am not very savvy with the Polymer template solution, but if that is an option, that would be helpful to know of, too.
Tori Santonil:
I’m not sure how manually modifying the .jar file would be helpful.
The vaadin-grid-flow java compenent is based on the vaadin-grid-5.2.5.jar (polymer) webcomponent.
For me that modification was the fastest and simplest workaround. I could not manage it using computed bindings and I am not sure whether such a thing is possible.
I tried something similar like this using an own js function to increment the current index value:
Norbert Pocze help was great since Grid v 5.4.8.
Grid structure completely changed, moreover is in different jar: com.vaadin:vaadin-grid-flow.
Please help. How to change the grid, to enable row count starting with 1 instead of 0.
Thanks.
Honza.
Jan Halík:
Please help. How to change the grid, to enable row count starting with 1 instead of 0.
Changed to this code
__getRowModel(row) {
return {
index: row.index+1,
in the file META-INF\resources\webjars\vaadin-grid\src\vaadin-grid.html in .m2\repository\org\webjars\bowergithub\vaadin\vaadin-grid\5.4.8\vaadin-grid-5.4.8.jar using vaadin version 14.0.3 and vaadin.compatibilityMode=true still works with my project.
Honza, I agree. Where are the files of the grid component used by v14 located when compatibility mode set to false? Is it vaadin-grid-flow-4.0.5.jar ?
In the .m2\repository\com\vaadin\vaadin-grid-flow\4.0.5\vaadin-grid-flow-4.0.5.pom I see :
The problem with editing the vaadin-grid.html is that you need to apply this manual patching each time you update the framework.
One solution could be to add support for so called calculated data binding or in more generic case support for script part with template into TemplateRenderer, but that is not a trivial thing to do.