-
-
Notifications
You must be signed in to change notification settings - Fork 18
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feature(grid): ability to dynamically add or change Column Headers #65
Conversation
ghiscoding
commented
May 19, 2018
- We can dynamically add or change column definitions, see Example12 for a demo
- reference to issue Dynamically Add/Change Column Definitions and Grid Options #57
- We can dynamically add or change column definitions, see Example12 for a demo
@jmzagorski I ran a build and was amazed to see only 2 small errors, wow usually I have to fix like 30 undefined variables or whatever lol Anyway, I want this PR in before I push a new release. Do you have anything else in the pipeline before a release? Let me know please, I'd like to release in the coming days. Thanks |
with #42 all you have to do is change this: -@bindable({ defaultBindingMode: bindingMode.twoWay }) dataset: any[];
+@bindable dataset: any[]; The reason: I do not think we will ever be need to mutate the dataset...right? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a great feature! In my application I have a custom element called redux-grid
that uses your library and I had to implement a columnDefinitionsChanged
method because I was changing columns. I did not have to use BindingEngine
because I implement redux
which means when something in my column changes, the entire array is a new instance and the columnDefinitionsChanged
fires. It seems that I know can remove my implementation.
would you mind refactoring directly in the branch? I'm going out now and that would help if you can apply the change directly. Thanks |
will now close #42 |
but technically, a user could come and change the JSON dataset, I actually also do that with the OData backend service I think, which in that case is an empty array at first but then receives the data once backend replies (Example 5 is coded that way, if that example still works then I guess it's ok). We also need to support data insert (Example 11, in that case we push to the dataset/dataView. Unless I misunderstood, don't we still need a two way binding for that to work? If both Example 5 and Example 11 still works, then I would assume that we are good. Let me go and try it on same branch... ok both examples are working fine. I guess we are good to go then. Any last comment? |
It is fine if the user/viewmodel changes the dataset since those changes will always flow into the AureliaSlickgridCustomElement, but if AureliaSlickGridCustomElement class changes the dataset (ie changes the instance to another variable) then that change won't update the viewmodel dataset. As you found out in the examples everything should still work as expected Nothing more in the pipeline from me right now. |
ok good, so you said you can close #42 since it was incorporated in this PR ? |
Yes #42 can be closed after this is merged |