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

prop names with dots #596

Closed
TINITUS opened this issue Mar 14, 2017 · 6 comments · Fixed by #696
Closed

prop names with dots #596

TINITUS opened this issue Mar 14, 2017 · 6 comments · Fixed by #696

Comments

@TINITUS
Copy link

TINITUS commented Mar 14, 2017

I'm submitting a ... (check one with "x")

[ x] bug report => search github for a similar issue or PR before submitting
[ ] feature request
[ ] support request => Please do not submit support request here

Current behavior

When property names are with dot notation like from an elastic search :
"body.property.subproperty" the deep-getter fails to retrieve the value of the cell
Expected behavior

Deep-getter should have a check if obj[path] returns a value and if no then it can proceed in destructuring the path.
Reproduction of the problem
Provide an object with keys names in following format:
"main.property"
"main.property.subproperty"

What is the motivation / use case for changing the behavior?

when using the datatable with serverside Java elastic search
Please tell us about your environment:

os: win32 x64

  • Table version: 0.7.x
    6.3.0
  • Angular version: 2.0.x
    @angular/cli: 1.0.0-rc.1
    node: 6.9.2
    @angular/common: 2.4.9
    @angular/compiler: 2.4.9
    @angular/core: 2.4.9
    @angular/forms: 2.4.9
    @angular/http: 2.4.9
    @angular/platform-browser: 2.4.9
    @angular/platform-browser-dynamic: 2.4.9
    @angular/router: 3.4.9
    @angular/cli: 1.0.0-rc.1
    @angular/compiler-cli: 2.4.9
  • Browser: [all | Chrome XX | Firefox XX | IE XX | Safari XX | Mobile Chrome XX | Android X.X Web Browser | iOS XX Safari | iOS XX UIWebView | iOS XX WKWebView ]
  • Language: [all | TypeScript X.X | ES6/7 | ES5]
@amcdnl
Copy link
Contributor

amcdnl commented Mar 15, 2017

If you do [prop]="'foo.bar.cat'" does it work? Can you provide a demo?

@TINITUS
Copy link
Author

TINITUS commented Mar 16, 2017

I am using columns array to set up columns as I need to provide those fromthe outside in order to create a generic grid list. That's why I haven't tested with template way of setting in columns.
I will try to provide demo by the end of today.
Here is a simple demo: http://embed.plnkr.co/XzyW4uZ1Kiz8BIN61h74/

@arlowhite
Copy link
Contributor

Just FYI #494 changes valueGetter code a bit and renames deep-getter.ts to column-prop-getters.ts
So if #494 is merged when someone works on this, look for that file instead.

@TINITUS
Copy link
Author

TINITUS commented Mar 17, 2017

Sure, Arlowhite, I saw your PR but tnx for the notice.

@arlowhite
Copy link
Contributor

My PR was just merged. :)
So fixing this is just a few lines of code in column-prop-getters.ts

I will create a PR to fix this soon unless someone else says they're already working on it.

@amcdnl
Copy link
Contributor

amcdnl commented Apr 15, 2017

@arlowhite - did you have a chance to make this PR yet?

arlowhite added a commit to arlowhite/ngx-datatable that referenced this issue Apr 20, 2017
amcdnl added a commit that referenced this issue Apr 24, 2017
unit test deepValueGetter. fix #596 prop field name with dots.
uejb pushed a commit to uejb/ngx-datatable that referenced this issue Apr 25, 2017
rsparrow pushed a commit to rsparrow/ngx-datatable that referenced this issue Jun 2, 2017
rsparrow pushed a commit to rsparrow/ngx-datatable that referenced this issue Jun 2, 2017
unit test deepValueGetter. fix swimlane#596 prop field name with dots.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants