Skip to content
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

2.0.7 #511

Merged
merged 41 commits into from
Jul 2, 2013
Merged

2.0.7 #511

merged 41 commits into from
Jul 2, 2013

Conversation

jonricaurte
Copy link
Contributor

This release is mainly focused on fixing the grid layout/column widths:

Columns

  • Removed border-left and border-right from columns. Now we are using vertical bars so if someone sets a width to be 400px for a column, the column will actually be 400px, not 401-402px due to the border. This caused the horizontal overflowing to happen producing a horizontal scrollbar. This also fixed issues like Rows not filling grid border #411 where you would see columns not extend all the way to the edge and you would get double borders
  • Percent calculation is handled before asterisks calculations because percent calculation should take higher priority, and the asterisks calculations will then be able to fill the remaining space instead of horizontally overflowing the viewport

A fix contributed by @swalters for #436:

Editing Cells

When editing a cell, the ng-cell-has-focus directive will broadcast a message named ngGridEventStartCellEdit to let all children know that you can now give yourself focus. When the editable cell template is done with editing (usually on a blur event) you need to emit ngGridEventEndCellEdit to let ng-cell-has-focus know that you are done editing and it will then show the non-editable cell template. The reasoning for this is (good quote): "Now I can wrap my input elements in divs/spans, whatever and control exactly what element's blur triggers the end edit" - @swalters. An example (used for ng-input directive):

scope.$on('ngGridEventStartCellEdit', function () {
elm.focus();
});

angular.element(elm).bind('blur', function () {
scope.$emit('ngGridEventEndCellEdit');
});

Also, there is another option now which is enableCellEditOnFocus (yes, it's coming back) so now you can choose between excel-like editing or enabling edit mode on focus.


Also some fixes contributed by @ebbe-brandstrup are:

configureColumnWidths

  • Columns sized with * or % now expand / shrink as other * or %-based columns are hidden / shown
    • Note: the changes auto-expand/shrink only take effect on-the-fly
    • Works with grouping and when enabling the selection checkbox row (showSelectionCheckbox)
  • Bugfixes in configureColumnWidths
    • Re-ordered columns now keep their width setup
    • Fixed "asteriskNum" so it no longer includes hidden columns (was checking .visible on a columnDefs column instead of the matching ngColumn)
    • Fixed "totalWidth" so it no longer includes hidden columns when using px values for width (was checking .visible on a columnDefs column instead of the matching ngColumn)
    • Fixed ngColumn width being initialized to undefined when using "auto" for width, regardless of "minWidth" settings (was checking .minWidth on a columnDefs column instead of the matching ngColumn)

Renamed "col" to "colDef" in configureColumnWidths() in the places where "col" was a column from "columnDefs". It made it clearer for me whether I was referring to a ngColumn or a column from columnDefs. There were a couple of bugs caused by that (col.visible incorrectly accessed on columnDefs objects instead of ngColumns, and the like).

ng-grid-flexible-height plugin

  • Bugfixes in ng-grid-flexible-height
    • The plugin couldn't shrink the grid, only grow it
    • Using domUtilityService.UpdateGridLayout instead of grid.refreshDomSizes which correctly grows the grid if it's been shrunk (e.g. when paging to the last page and it has few rows + the plugin has a smaller min. height than what's needed on the other pages)

jonricaurte and others added 7 commits June 24, 2013 22:04
…ly take effect on-the-fly if using the ng-grid-layout plugin)

- Columns sized with * or % now expand / shrink as other * or %-based columns are hidden / shown
- Re-ordered columns now keep their width setup
- Bugfixes in configureColumnWidths
  - Fixed "asteriskNum" so it no longer includes hidden columns (was checking .visible on a columnDefs column instead of the matching ngColumn)
  - Fixed "totalWidth" so it no longer includes hidden columns when using px values for width (was checking .visible on a columnDefs column instead of the matching ngColumn)
  - Fixed ngColumn width being initialized to undefined when using "auto" for width, regardless of "minWidth" settings (was checking .minWidth on a columnDefs column instead of the matching ngColumn)
- ng-grid-layout plugin now listens to 'ngGridEventColumns' events and then rebuilds the grid

Renamed "col" to "colDef" in configureColumnWidths() in the places where "col" was a column from "columnDefs". It made it clearer for me whether I was referring to a ngColumn or a column from columnDefs. There were a couple of bugs caused by that (col.visible incorrectly accessed on columnDefs objects instead of ngColumns, and the like).
  - The plugin couldn't shrink the grid, only grow it
  - Using domUtilityService.UpdateGridLayout instead of grid.refreshDomSizes which correctly grows the grid if it's been shrunk (e.g. when paging to the last page and it has few rows + the plugin has a smaller min. height than what's needed on the other pages)
@jonricaurte
Copy link
Contributor Author

Here is how you can reference 2.0.7 currently through plunker: http://plnkr.co/edit/dyA446?p=preview

c0bra and others added 5 commits June 26, 2013 09:45
For some reason, getting an object constructor name as a string in IE adds
a single space at the end.  This was breaking a couple plugin test specs,
and could possibly have been breaking other things as well, in the case
that the plugin needed to be referenced by name.
Cell navigation broke due to there being an extra element in the cell.
Also changed the color of the focused cell to be different than selected
rows to be easier to identify. Fixed issue #510. Now when mouse clicking
within cell, rows won't keep being selected and deselected.
Fixed issue where if selection column was hidden, rows wouldn't take up
the remain space. Fixed issue where if columns were reordered, then one
was hidden, then reordered again, then made the one hidden visible,
columns would then be overlapping since the column indexes would be the
same.
ng-input now selects the input element
@jonricaurte
Copy link
Contributor Author

Can you give a plunker? Tried doing the same thing locally on index.html and index6.html in our workbench and never got any errors. I get:

columns[i].children[1] = <div ng-cell></div>

@swalters
Copy link
Contributor

My apologies. I jumped the gun. We have a custom rowTemplate that needed changing.

@swalters
Copy link
Contributor

Did the config for Pinned columns change? I don't see the icons for pinned columns:
http://plnkr.co/edit/TC47qt?p=preview

@jonricaurte
Copy link
Contributor Author

It didn't change. It looks like they also aren't showing up in the current version of ng-grid. hmm

@jonricaurte
Copy link
Contributor Author

Will check on it when I get home.

Fixed initial grouping issue when using
domUtilityService.RebuildGrid($scope, grid).
Switched vertical bars to be on right so columns pinned on left have
right border.
@jonricaurte
Copy link
Contributor Author

Ok. I'm planning on pushing out the release tomorrow.

@c0bra
Copy link
Contributor

c0bra commented Jun 28, 2013

All the tests are passing on Ubuntu. I don't have access to a Mac currently but I can test that later.

@jonricaurte
Copy link
Contributor Author

Either do I. Hmmm . Just to let everyone know, the landing page is now using 2.0.7: http://angular-ui.github.io/ng-grid/

We need to figure out a way for this to work for different edge cases.
ngGrid is watching column defs so that is getting called which is
calling the rebuild.
totalServerItems should only be set using a string reference. If it is
something else, will be set to 0.
@jonricaurte
Copy link
Contributor Author

Ok, so now I know why totalServerItems was removed. According to @timothyswt "we switched out the place where totalServerItems is set because people
wanted to update it manually while watching the pagingOptions configuration
variable for changes (so they know when to retrieve more data from the
server)." from #332

[EDIT] Removed from the paging options

@jonricaurte
Copy link
Contributor Author

Ok, so now the only issues that need to be fixed are #465 #279 and #520

Now if user changes column widths, *s and percentages will not be taken
into account so column widths stay the same when grid data is being
updated.
@jonricaurte
Copy link
Contributor Author

Now just need to fix #465 and #279

@ebbe-brandstrup
Copy link

Thumbs up!

On Monday, July 1, 2013, jonricaurte wrote:

Now just need to fix #465https://github.com/angular-ui/ng-grid/issues/465and
#279 #279


Reply to this email directly or view it on GitHubhttps://github.com//pull/511#issuecomment-20263710
.

@jonricaurte
Copy link
Contributor Author

One more to go!

@jonricaurte
Copy link
Contributor Author

Done

@jonricaurte
Copy link
Contributor Author

and tired

jonricaurte added a commit that referenced this pull request Jul 2, 2013
@jonricaurte jonricaurte merged commit 549c8b5 into master Jul 2, 2013
@kartb7
Copy link

kartb7 commented Aug 24, 2014

I want to create a custom directive on ng-grid. Also load "Data" and Global Configuration Settings(showFooter,enablePinning..etc..) dynamically from backend DB. Is that possible?..please help...

@JLLeitschuh JLLeitschuh deleted the 2.0.7 branch January 19, 2016 17:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants