Comments (5)
with 10000 rows i'm seeing 3-5ms on chrome....so maybe this is a moot point:
whosDirty : function(cmp){
console.time('test');
cmp.find('tableBody').get("v.body").forEach(function(item){
_.each(item.get('v.rowData'), function(rd, key){
if(rd.isDirty){
console.log("I'm dirty:" + key);
}
});
});
console.timeEnd('test');
}
(about the tablebody.find stuff....I'm constructing the rows dynamically without an iteration, so a straight cmp.get('v.data') is giving me a different object than what ends up being on the row...ugh)
from lightning-data-grid.
I have been giving saving a lot of thought, but I've been heads down on the searching, filtering and sorting when I've had free time for this.
At the very least, I think the grid should be providing something like whosDirty in an invocable manner so we don't need to re-implement it on every new grid.
from lightning-data-grid.
Also, how is constructing the rows dynamically going for you? I experimented with that for a bit, and still think it could buy performance savings when the view is updated, especially if some caching mechanism is added for rows that already been seen before. A lot more code overhead to keep track of the bits and bobs though.
from lightning-data-grid.
I tried a few things, the ultimate goal being when you get close to the bottom scroll wise, it loads the next 'page' of records. I've tried 5 implementations of helper.addRows for this, adding 50 rows to the bottom each time:
(ps - my c:row body for this was just a hardcoded TR, no dynamic cells)
- looping over next 50 data items and producing an array of configs to pass to A.createComponents
- looking over the next 50 items calling A.createComponent inside the loop
- raw HTML fragment.appendChild
- Using aura:iteration and just increasing the items is v.items
- Using a 'component store' so I call createComponents doing init, and create say 1000 components, then, in the addRows method, I can pull from the 'store' and append to the tableBody.v.body
In the chrome performance tab you can clearly see the bottle neck is the THOUSANDS of function calls in the createComponent spiderweb. My not scientific benchmarks were approx:
- 1300ms
- 3000ms
- <400ms
- 2000ms
- 700ms (WAY longer on init)
Method 5 is very intriguing, if you could find a way to fill the store during user interaction lulls, a few pieces at a time. Or do something with WebWorkers. Still, HTML Tables? this is web 101.
I've spent a good amount of time in the source for ui:virtualDataGrid in the aura framework and force:inlineEditGrid, but they take advantage of APIs that are blocked with locker service. I keep wondering if just doing something on top of lighting, like baking in slickgrid or equivalent would be better than this hassle. That or just deal with less than ideal performance and see what the next 6 months brings.
I'm not actually using your source for this, or I'd send you a branch. I had developed something pretty similar on my own when I found this, and thought maybe we could synergize a bit. That said, I do have the code in a DX repo, so if you're interested, I can share.
from lightning-data-grid.
Yeah, I think doing something with slickgrid is probably the path of least resistance right now. But my original goal with this was to make it as natively lightning as possible to force myself to use the framework. That and lightning:treegrid still being Spring '18 at the earliest were the motivations for this project.
Thank you for sharing!
from lightning-data-grid.
Related Issues (20)
- handleChildToggle doesn't respect child Expanded Rows HOT 1
- Child Row Templates
- Scrolling Improvements HOT 1
- Config option for Tree HOT 1
- Ability to add new rows to the Grid
- Firefox support
- Fixes for Winter 18 HOT 1
- Replace Loading Spinner with Stencil
- Weird lightning:buttonIcon issue HOT 2
- Lightning:RecordFormView (and Edit) Support
- AuraDoc
- Horizontal Scrolling is broken
- can't reinitialize the DataGrid with new data HOT 3
- Is there currently anyway to programatically expand a specific row on load? HOT 2
- Eliminate Aura:If in Cell HOT 1
- Provide Githubsfdeploy hook
- Row Selection
- Failures
- What is the license for the component
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 lightning-data-grid.