Comments (9)
I would prefer passing an expandIf
function to the column plugin. If the function returns true for a row, the node and and all of its ancestors are rendered expanded.
from dgrid.
+1
That's a much better idea.
from dgrid.
I realize that in my first comment, I had things backwards. expandIf
will only be called when a row is inserted, thus its ancestors have already been expanded.
Determining the depth of a node from within the expandIf function could still require walking up the tree to count nodes. I suggest that it receives the depth as its second argument.
from dgrid.
Or the nodes can have a depth property that the expandIf function can check.
from dgrid.
If you are using lazy loading, there may be situations where the depth of a record is unknown unless you walk up the tree.
from dgrid.
Doh. I'm an idiot ;)
from dgrid.
I've taken a stab at this with #172. Open to comments for the time being.
Thanks @mikerobi for the idea of conditionalizing it. Initially I was very reluctant to entertain the idea of blanket auto-expand, just because I don't like tempting people to use it without considering the consequences (especially if it's being used with a non-memory store, i.e. going back to the server for each request for children).
However, it is a request that comes up fairly often, and this also gave me the opportunity to also allow "preserving" of expanded states when rows get unrendered and re-rendered later (either from scrolling or observer-induced remove/insert operations).
from dgrid.
Awesome, I will test this out now. I've been running into more and more problems with reexpanding trees after refreshing them.
from dgrid.
Closing this now, since #172 has been merged. Thanks @swiftdemise for the additional feedback and tire-kicking.
from dgrid.
Related Issues (20)
- ColumnSets with CompoundColumns and ColumnResizer does not always resize correctly.
- horizontal scrolling alignment issue dgrid
- horizontal HOT 1
- rowindex HOT 1
- Is this project still maintained? HOT 2
- DGrid 'select all' checkbox is not working as expected HOT 2
- OnDemandList does not refresh on store.setData HOT 2
- build issues with dojo 1.16 HOT 7
- Editor focusout handler is stopped when a row is removed
- CheckBox Editor does not work as expected in Safari HOT 3
- Removed row handing in Editor onblur HOT 2
- Editor: browser blur with active Select leads to bugged editor
- Update Intern from 3 to 4
- (ColumnSet +) CompoundColumns_findSortArrowParent(field) fails to find parent out of the 1st column set
- Website still points to v1.2.1
- Dgrid selector inconsistently working in touch screen devices like ipad dgrid/v1.1.0 HOT 10
- dgrid version 1.3.3 is breaking formatter function in dgrid HOT 2
- How to set dgrid editor checkbox readonly conditionally ?
- dgrid does not throw error on scroll (http-status-code) HOT 2
- dgrid.cell().element is undefined
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from dgrid.