3.0 Release
Major architectural overhaul
We have come up with a better architecture design for the grid and will be working here int he near future to bring you all the grid you and angularjs deserves.
More to come.
Sounds great! How can I contribute? I have quite some experience with Angular, and would be willing to help.
For my current project I have written a 'DataSource' class which helps you to bind data coming from a JayData EntitySet to an ngGrid. It takes care of paging, filtering etc. I think it would be a good idea to include these kind of helpers (other people could write one for BreezeJS etc) in the ngGrid project itself.
I also have some ideas about how to make sure that you have full control over everything that happens in the Grid. Such as:
- Make all default (key) events cancel-able. It is great that the Grid has good defaults, but sometimes you just want to do things differently.
- Make sure that all options etc work two ways. For example, currently changing the 'selectedItems' does not (de)select items in the grid.
Starting to look at the declarative markup for a version 3.0. Please take a look and share your thoughts.
https://github.com/angular-ui/ng-grid/blob/3.0/Brainstorm.md
I personally find directive attributes very unreadable. I'd much rather have them as element names and avoid the divitis.
<ui-grid>
<ui-grid-header>
<!-- auto-generate column headers if no content supplied? -->
</ui-grid-header>
<!-- ui-grid-repeat auto-generates columns, ui-repeat-virtual handles the actual virtual repeater functionality? -->
<ui-grid-repeat ui-repeat-virtual="d in data">
<!-- auto-generate columns if no content supplied? -->
</ui-grid-repeat>
<!-- or perhaps this?? (from ProLoser) -->
<ng-repeat="item in $virtualized" ui-virtualize="items">
<!--
ui-virtualize virtualizes a list of items and hands it to the built-in repeater, if the repeater is performant enough
-->
</ui-grid>
@matthughes that's personal preference. The directives can be restrict: 'EA' and you can use whichever method you want.
Being able to toggle edit mode without having to switch templates and rebuild the entire grid. Is this going to be part of 3.0?
@robsmithers It shouldn't do that right now. Can you make a plunker?
The reason for not using divs would be to not have to use jquery for accessing elements. Right now angular's element.find() only supports tag names:
http://docs.angularjs.org/api/angular.element
@jonricaurte Your right, it does not do that right now, I'm suggesting that as a feature. You shouldn't have to replace the grid template and rebuild to go from read-only mode to edit mode.
If it's possible, It would be nice if ngGrid provided with more functions / features / documentation for unit testing. I am using ngGrid in a project and I feel it's really hard to test functions that interact with ngGrid.
Thank you
TDD is a major focus for us moving forward. If you can describe the interactions you want to test that would be great. On Dec 11, 2013 8:43 PM, "Drahakar" [email protected] wrote:
If it's possible, It would be nice if ngGrid provided with more functions / features / documentation for unit testing. I am using ngGrid in a project and I feel it's really hard to test functions that interact with ngGrid.
Thank you
— Reply to this email directly or view it on GitHubhttps://github.com/angular-ui/ng-grid/issues/727#issuecomment-30385117 .
@c0bra ideally, everything the grids allows should be "emulable" in unit test. More precisely, here are some test cases that I can think of :
- Emulate a row selection (suppose I'd like to see some calculation go on when a row is selected)
- Emulate a cell edit (same reasons)
- Be able to validate that all/some (of) the rows were selected/unselected
- (any other grid interactions with the controller)
Also, if a controller is using some of the grid functions (like selecting a row), I need to declare a ng-element that contains a ngGrid and compile this element to get the grid functions into my scope (otherwise the grids method are not "added" into the scope). Would there be a way to remove the need for that?
Maybe there is already a way to do all of these, but I find it really hard to get documentation on how to unit test my interactions with the grid (without writing e2e tests). It would make my daily life easier if I could get more features / documentation to unit test controllers that uses the grid.
Thank you.
@Drahakar It's difficult to emulate some browser interactions in unit tests. That's kind of what e2e tests are for. Though for some things (row selections, etc), that CAN be done in unit tests.
You have to compile an element with the ng-grid attribute to test ng-grid's functionality. There's not composable and separate grid services that you can test separately in controller stubs. Doing griddish things requires a grid. That's going to be the same for pretty much any directive you want to test against, though.
In the 3.0 branch, I've set up e2e tests with Protractor that will run against examples + test scenarios that are built with ngdoc. So all of the examples, guides, and tutorials in our docs should have test scenarios that will perform what you are describing (with Protractor), and will be kept up to date and passing as new releases come out.
Please create 3.0 tag in issues so it's easier to track future development and bugs in new branch.
Performance notes:
- There's too much going on when scrolling - it's slow and stuttery even with small number of rows and columns, and that's said sitting on quite powerful computer and webkit (Chrome) See i.e. #866. There is a room for serious improvement there. The more we add on top of browser(-optimized) scrolling (clipping) the slower it becomes. The most basic example: static
overflow:clipelements are butter-smooth when scrolling, but ng-grid is stuttery even when not using virtualization (so in theory it should not do anything but let the browser scroll the contents of container). - Having ngAnimate enabled in the app kills the ngGrid performance. Initial scrolling is a disaster and then it's visibly stuttery as (probably) ngAnimate is doing its thing on newly added virtualized rows (among other things).
- Each element of the grid is an angular directive. While it's cool and dandy, it makes the whole thing heavy as a whale. I'd recommend doing some optimization there by keeping only essential ("dynamic") things in $scope and using "dumb" dom elements everywhere else.
Any further ideas from the top as to an approximate 3.0 release timeframe?
@jmwolfe I think we'll have a better idea of that next week. We are making progress in 3.0, but we are still in the 'laying the foundation' mode.
We will probably have a stable release soon with limited features. I'm pretty sure that grouping, column pinning, and probably paging controls won't be part of the first release. There could be other features missing as well.
Our goal is an extendable grid where features can be layered on without affecting the core grid. That's proving to be a challenge.
Help is always welcome and discussions are on freenode channel #ui-grid.
Anyone following this case want to contribute to the 3.0 development? We are still working on the core grid features. @c0bra is very close to finishing horizontal virtualization.
We will need help on other features such as Column moving, pinned columns, grouping, plugin support, etc.
If we get a good response, we'll arrange for a google hangout next week to review what was done so far and how the features can be implemented as additional angular modules.
Take a look at http://ui-grid.info for the current progress. See the docs and tutorials.
Sign me up for the hangout.
@swalters I would be very much interested in contributing. I think an extensible grid is an awesome idea. It might be a good idea to use the same approach as projects like karma and gulp:
- A core which is as lean as possible.
- All non-core features are implemented as separate plugins, making plugins first-class citizens.
- Plugins are separate projects.
- The non-core plugins, written by the team, serve as example.
As soon as I find some time I will take a look at the current progress, and see what I can pick up. I think I would like to make plugins / adapters / helpers for:
- JayData
- Kendo Datasource
- BreezeJS
please add feature such this https://github.com/angular-ui/ng-grid/issues/644
[edited] sorry I don't know that ng-grid has new site http://ui-grid.info/, I refers the old one before. thanks