Hi
I'm using virtual scrolling in a grid and want to show and hide columns dynamically.
While doing so, it seems to work first, but breaks, after scrolling down.
Hiding column 2 and scrolling down, removing column 2 values and replaceing them with column 3 values.
See example for this behaviour:
http://dojo.telerik.com/EJOZAJob/6
How to fix column values switching while scrolling and remaining correct columns and values on scroll.
Greets Robin
5 Answers, 1 is accepted
Hello, Robin,
Thank you for keeping the thread updated.
The issue you are experiencing is due to the presence of a rowTemplate. When a row template is defined, the Kendo UI Grid does not use its own template so it becomes the responsibility of the developer to handle the hide, show and column reorder as you have discovered.
I would suggest using column templates instead for simplicity if at all possible in your scenario which will remove any need for programmatic template handling.
https://www.telerik.com/forums/columnhide-not-working-with-row-templates
Also, there is no need to make the data items observable, you can just pass the data array to the data source - the widget will internally transform them to observable as noted in the documentation here:
https://docs.telerik.com/kendo-ui/api/javascript/data/datasource/configuration/data
Kind
Regards,
Alex Hajigeorgieva
Progress Telerik
Hi Alex
Thanks for clearance.
Think I'll try to use columns template next time and use row bind in another way.
The observable part is from another problem I need to handle:
Greets Robin
Hello, Robin,
You should be able to redraw the row of the grid with this approach we have in the knowledge base:
https://docs.telerik.com/kendo-ui/knowledge-base/grid-update-particular-row-without-refresh
If you do not see any issues with it, you will be able to remove the extra code, what are your thoughts on that?
Kind
Regards,
Alex Hajigeorgieva
Progress Telerik
Hi
I'd prefer to update the one cell which got an update, instead the entire row.
beside that I do not had this example, but another one from the internet which I did not get to work.
Don't know what was the issue.
This time I will stay on my solution cause it's all live yet, so may try next time.
Greets Robin