Skip to content

Conversation

@mirik123
Copy link
Contributor

Hi,
I'm the author of OData plugin in free-jqgrid project.
You can see the details here: grid.odata.js, wiki.
After releasing plugin in a stable version I decided to move my steps to the angular project.

The angular ui-grid-odata feature does the following:

  1. queries odata source by the $http provider.
  2. parses $metadata response.
  3. builds column definitions based on odata metadata
  4. when NavigationProperties exist - configures ui-grid-expandable feature and builds multilevel subgrids.

TODO actions:

  1. add search filters to odata requests (now available only at client-side filtering)
  2. test and fix grid updates
  3. fix ui-grid-expandable bugs:
  • plus signs should not appear when ui-grid-expandable exists but enableExpandable = false
  • filter header doesn't appear in main grid when enableFiltering=true and exists ui-grid-expandable (it still works in subgrids)
  • grid rows cannot be multiline (should have dynamic height)
  • subgrid heights are not calculated correct (should have dynamic height)
  • main grid doesn't change its height when subgrid expands
  • when subgrid expands it drops its shaddow bottomside to the rest of sequential rows, thus they become unclickable.
  • inner multilevel subgrids are not rendered correctly.

Using example:

var app = angular.module('app', ['ui.grid', 'ui.grid.expandable', 'ui.grid.odata']); app.controller('MainCtrl', ['$scope', 'gridUtil', function ($scope, gridUtil) { $scope.myGrid = { expandableRowTemplate: 'ui-grid/odataExpandableRowTemplate', odata: { metadatatype: 'xml', datatype: 'json', expandable: 'link', entitySet: 'Products', dataurl: "http://services.odata.org/V4/OData/OData.svc/Products", metadataurl: 'http://services.odata.org/V4/OData/OData.svc/$metadata', gencolumns: true } }; $scope.myGrid.onRegisterApi = function (gridApi) { gridApi.expandable.on.rowExpandedStateChanged($scope, function(row) { gridUtil.logDebug('expanded: ' + row.entity.Description); }); gridApi.odata.on.success($scope, function(grid) { gridUtil.logDebug('succeeded'); }); gridApi.odata.on.error($scope, function(data, message) { gridUtil.logError(message); }); }; }]);
<div ng-controller="MainCtrl"> <div id="grid1" ui-grid="myGrid" ui-grid-odata ui-grid-expandable></div> </div>
@mirik123
Copy link
Contributor Author

TODO: add odata.spec.js file.
TODO: replace glyphicon with some other icon already available in angular (need advice).

@JLLeitschuh
Copy link
Contributor

You're going to need to squash this into one commit. Also, if your commit messages follow this guideline: https://github.com/angular/angular.js/blob/master/CONTRIBUTING.md#commit they will properly be parsed by our changelog generator.

@JLLeitschuh
Copy link
Contributor

I'm not sure if this is better as a plugin instead of a built in feature.

@mirik123 mirik123 changed the title new odata feature feat(uiGridOdata): new feature for supporting odata protocol Aug 22, 2015
@mirik123
Copy link
Contributor Author

I think it is more feature than core part because it highly depends on another ui-grid-expandable feature in order to show subgrids for odata NavigationProperties and ComplexTypes.
If you implement expandable subgrids at core level than odata can also be a core.

Functions uiGridODataService:format and uiGridODataService:concat still can be moved to gridUtil.

Please approve/decline this commit because I would like to develop something on this weekend.
:)

@JLLeitschuh
Copy link
Contributor

Come chat with us about this here: https://gitter.im/angular-ui/ui-grid

@mirik123
Copy link
Contributor Author

will be added to the new ui-grid/features repository...

@mirik123 mirik123 closed this Aug 27, 2015
@rodrigopivi
Copy link

You should look at Breeze, I've done some work on implementing a breeze extension for ui-grid, i can totally collaborate in building that again using my previous experience.

@mirik123
Copy link
Contributor Author

Breeze odata format is different from standard odata format supported by http://www.odata.org so, breeze client is 100% compatible only with breeze server.
It also requires including 2 extrernal files - breeze.js and datajs.js
It doesn't support odata v4 - Olingo project is still in beta olingo.apache.org.
Whereas my feature is fully selfsufficient and depends only on standard ui-grid features.

It will nice to see pure-angular v3/4 datajs plugin without jquery and other external dependencies.

@mirik123
Copy link
Contributor Author

@c0bra
Copy link
Contributor

c0bra commented Sep 11, 2015

@mirik123

Scripts from raw.githubusercontent.com won't load in because of MIME-type checking. You can change:

https://raw.githubusercontent.com/mirik123/ui-grid-odata/master/js/ui-grid-odata.js

to:

https://rawgit.com/mirik123/ui-grid-odata/master/js/ui-grid-odata.js

to get it to load.

@mirik123
Copy link
Contributor Author

fixed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

4 participants