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

Field nested and with dots in key's not showing #164

Open
p0psicles opened this issue Jul 24, 2017 · 3 comments
Open

Field nested and with dots in key's not showing #164

p0psicles opened this issue Jul 24, 2017 · 3 comments

Comments

@p0psicles
Copy link

I'm trying to show a nested field, with dot's in the key.
Like:

"results": [{
"displayId": "asfsfsf",
"metadata": {
			"com.atlassian.bitbucket.server.bitbucket-branch:latest-commit-metadata": {
..

I'm using the following fields configuration:

fields: [
        'displayId',
        {
          name: '["metadata"]["com.atlassian.bitbucket.server.bitbucket-branch:latest-commit-metadata"]',
          title: 'pullRequest'
        }
      ],

The displayId is showing. But the pullRequest fields, is not showing anything.
The key is not available for all rows, so that could also have something to do with it. But I expect that it would would just leave that empty in that case.

What is the best way of configuration this?

@ratiw
Copy link
Owner

ratiw commented Jul 27, 2017

@p0psicles Vuetable treaats the . in the key name as nested field, so when your key field inside metadata contains . it will try to look deeper into the structure for the given key. So, it will not work as expected in this case.

Unless you modified your key inside metadata to use something other than ., like underscore _, this would work:

"results": [{
"displayId": "asfsfsf",
"metadata": {
    "com_atlassian_bitbucket_server_bitbucket-branch:latest-commit-metadata": {
..
fields: [
  'displayId',
  {
    name: 'metadata.com_atlassian_bitbucket_server_bitbucket-branch:latest-commit-metadata',
    title: 'pullRequest'
  }
],

@p0psicles
Copy link
Author

Unfortunately I do not have any control over the data being send back. Also there is no incentive for them to change it as it's valid json.

Isn't there any other way?

@ratiw
Copy link
Owner

ratiw commented Jul 28, 2017

@p0psicles Use the transform function. See here Or, create a component to handle it.

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

No branches or pull requests

2 participants