gestixi / sproutcore-table Goto Github PK
View Code? Open in Web Editor NEWA table view for Sproutcore
A table view for Sproutcore
After fixing the column header width issue I found that changing the column width or changing it's position does not always reload the visible rows (using Sproutcore 1.11). The visible rows retain the original width and position. Scrolling the view or clicking on the visible rows does cause them to reload but looks odd.
Clicking on a row and scrolling up and down prior to attempting the width or order change causes it to work properly. Resort a column so the data reloads and it to goes back to the original behavior where the rows do not reload properly.
The reload() function in SC.TableView is not causing the rows to be rendered via the SC.TableRowView render() or update() functions. This seems to be an issue down in the SC.CollectionView where if the exampleView is pooled and the content doesn't change the rows are not reloaded.
Setting isReusable to false stops the row views from being pooled and fixes the problem for me. I am using the default cell content via the renderTableCellContent(). My cells are simple divs around simple text so redrawing the visible cells every time is not expensive. This might be a problem for more elaborate cell layouts.
I looked into turning off isReusable temporarily during a column resize or reorder but this appeared complicated. I was wondering if you have any suggestions.
By the way the jslewis SCTable (https://github.com/jslewis/sctable) has this same problem with Sproutcore 1.11.
When attempting to change the width of a column the header view grows and shrinks erratically. After investigating it appears the event.pageX value used the first time SC.TableHeaderView:mouseDragged() is called is undefined causing the newWidth calculation to generate erratic values.
This can be solved by saving the X position in the mouseDown() function then checking the event.pageX for undefined in mouseDragged(). If so use the saved X position.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.