Skip to content

feat (table): Updated table component to support sorting on nested object properties. #1868

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

Merged
merged 1 commit into from
Oct 23, 2018

Conversation

bobzurad
Copy link
Contributor

@bobzurad bobzurad commented Jun 7, 2018

I noticed that you can't sort a table if the key is a nested property. This fixes that. See the example in the components/table/readme.md that the address.city column can now be sorted.

@codecov
Copy link

codecov bot commented Jun 7, 2018

Codecov Report

Merging #1868 into dev will decrease coverage by 0.09%.
The diff coverage is 45.45%.

Impacted file tree graph

@@            Coverage Diff            @@
##              dev    #1868     +/-   ##
=========================================
- Coverage   60.83%   60.73%   -0.1%     
=========================================
  Files         154      154             
  Lines        2885     2893      +8     
  Branches      798      799      +1     
=========================================
+ Hits         1755     1757      +2     
- Misses        812      818      +6     
  Partials      318      318
Impacted Files Coverage Δ
src/components/table/table.js 75% <45.45%> (-1.24%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update dd7ace3...292a875. Read the comment docs.

@tmorehouse tmorehouse merged commit b699e4b into bootstrap-vue:dev Oct 23, 2018
shinrox added a commit to shinrox/bootstrap-vue that referenced this pull request Oct 26, 2018
* dev: (31 commits)
  feat(card): support left and right image placement (bootstrap-vue#1981)
  fix(collapse/toggle): "collapsed" class cleared when component updated (bootstrap-vue#2102)
  fix(form-file): Add validation of single file (bootstrap-vue#2028)
  chore(docs): minor update to the b-form-input docs
  chore(docs): Minor update to b-form-input docs
  feat(table): Add row-unhovered event (bootstrap-vue#1874)
  feat(table): Support contextmenu event binding for table rows (bootstrap-vue#2064)
  docs(table): fix minor typo (bootstrap-vue#2093)
  feat(table): Support sorting on nested object properties (bootstrap-vue#1868)
  perf(modal): optimize model.resetScrollbar, resolves bootstrap-vue#1831  (bootstrap-vue#1837)
  docs: Update images reference section (bootstrap-vue#1999)
  fix(observe-dom): fix comment typo (bootstrap-vue#2084)
  chore(modal): trivial word fix in comment (bootstrap-vue#2089)
  (docs): Fix grammer in Intro readme (bootstrap-vue#2092)
  fix(modal): prevent scrolling on .modal-content focus, fixes bootstrap-vue#1748 (bootstrap-vue#2060)
  feat(pagination):  added slots for first, prev, next, last, and ellipsis. Fixes bootstrap-vue#1870. (bootstrap-vue#1980)
  Handle state change on validated fields. (bootstrap-vue#1984)
  fix(docs): input group prepend slot typo (bootstrap-vue#2059)
  fix(dependencies): replace opencollective with opencollective-postintall (bootstrap-vue#2067)
  fix(docs): change b-input-group attribute 'left' to 'prepend' (bootstrap-vue#2017)
  ...
value = value[path[i]]
}
return value
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since lodash.get was already imported into b-table and used when computing the field values, PR #2149 eliminates the need for this custom function by switching over to use _.get

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also, _.get handles properties that are not found (i.e. undefined) allowing for a fallback default value.

@tmorehouse tmorehouse mentioned this pull request Nov 14, 2018
89 tasks
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.

2 participants