Comments (11)
I'm not sure that you can go with a oneWay
binding on dataset
, especially Example 11 where it adds item on the fly.
You can give it a try, I might be wrong but I thought twoWay
was more appropriate. Like in my current App, I a "Create Item" which will add it to the grid (on first row) once the item is created, just like in Example 11
from aurelia-slickgrid.
it should still work. I think the two way means that if you reset the dataset to something else it changes in the view model too. Give it a try and let me know your result when you have a chance, the change would be:
- @bindable({ defaultBindingMode: bindingMode.twoWay }) dataset: any[];
+ @bindable dataset: any[];
if you do discover a potential issue let me know and i can look at it, or this can just be added to the documentation.
from aurelia-slickgrid.
Well actually, the Service is probably doing the work, not the binding. So yeah you're probably right. What benefit will that give us? Performance?
Anyhow, can you make sure that the Example 11 still works after changing that. If that is ok, then I don't mind going ahead. We could also include it in the next upcoming release, if you have time to create PR
from aurelia-slickgrid.
there are two benefits i can think of
- Maybe a performance boost? Probably not noticeable, but Aurelia doesn't have to setup the two way communication on a dataset. This is a guess and not tested
- I can use a
@computedFrom
property on my viewmodel without specifyingone-way
in the view without getting that foreign error. So that is less to remember to do/setup for the user. In my app i dynamically generate urls using therouter
and use that dataset in my grid. For example, my serverdataset
iselements
and my viewmodeldataset
iseditUrls
in my viewmodel:
@computedFrom('elements')
get editUrls() {
return this.elements.map(e => ({
...e,
editUrl: this.router.generate('component-edit', { id: e.id })
}));
}
Example 11 does work, but I will be sure to test the other examples. I will submit a PR if you think this is helpful.
EDIT or I can just update the documentation with a "how to" if someone wants to do this? I'll let you decide.
from aurelia-slickgrid.
As long as all examples still works, I'm all good with it and yes I know we might not visually see a boost but it will still be there, less twoWay
is always better.
I assume you are using the grid without Backend Service API
, right? I mean you are simply passing your dataset to the same property, correct? If so, I assume you will be the first person to notice any issues with them, since I'm mostly using the Backend Service API (GraphQL)
on my side (in Angular that is, sadly I most admit).
Updating wikis are always good, we can always refer to them if any questions are brought up and these are all helpful. I often go back and read my own wikis, to know how I use things lol. The grid now has so many features, wikis are the best to keep track and be helpful to users.
EDIT
I now understand your @computedFrom
, do we always have to use that or does the previous way of using it still works? I wouldn't want to break anyone's code, at least not before a version 2.x
.
from aurelia-slickgrid.
i agree about wikis, I will do some thorough testing the best I can before making this change.
from aurelia-slickgrid.
ok when did u plan to have a PR for this? I was planning a release by tomorrow evening, should I wait for it or go ahead with a release tomorrow?
By the way, I'm going in vacation starting Saturday morning on the 14th. You'll be on your own after (for 3 weeks that is) :P
I don't mind you do releases though
from aurelia-slickgrid.
Go ahead and release, I want to make sure I test this enough since it is a small change that has a big impact.
Enjoy your much deserved vacation! I do not think I will need to release anything new while you are gone. From what I have seen so far today since I am working on the grid, it has everything I need.
from aurelia-slickgrid.
Just saw
EDIT
I now understand your @computedFrom, do we always have to use that or does the previous way of using it still works? I wouldn't want to break anyone's code, at least not before a version 2.x.
You do not have to use @computedFrom
after this change is in. I just used it in the example so aurelia did not keep retrieving the data every second. If we did not use @computedFrom
then aurelia would fallback to its dirty checking and call the getter every second.
from aurelia-slickgrid.
Sounds good then
from aurelia-slickgrid.
closed by #65
from aurelia-slickgrid.
Related Issues (20)
- Action Required: Fix Renovate Configuration
- Multiple number column filters of the same type affects only the last column HOT 3
- Some translations are not using namespace prefix HOT 4
- aurelia-cli/systemjs excel export fix HOT 6
- Text Filter is lost of focus when "suppressActiveCellChangeOnEdit = false" HOT 6
- No fixed units in scss variables HOT 10
- Slot for custom footer/header HOT 6
- Type-safe column definitions HOT 6
- Error following HOWTO Step by Step guide HOT 3
- formatter HOT 12
- Aurelia-slickgrid breaks other jquery references HOT 2
- Export column width sets on wrong column, when export to excel HOT 12
- 1st (zero) element is not highlited with this.aureliaGrid.gridService.highlightRow(index, delay, delay) HOT 3
- column names are not shown if the slickgrid table is not on the screen HOT 5
- Autosized width overflows parent div in bootstrap 3. HOT 10
- TypeError: Cannot set property dataset of #<HTMLElement> which has only a getter HOT 7
- Customizing GraphQL paging and sorting HOT 3
- Aurelia 2 support HOT 40
- Issues upgrading from v3.12.1 to v4.1.3 HOT 2
- Dependency Dashboard
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 aurelia-slickgrid.