Skip to content
This repository has been archived by the owner on Mar 9, 2022. It is now read-only.

Can't set columns from ancestor to child #51

Closed
wuzhiji37 opened this issue May 19, 2017 · 2 comments
Closed

Can't set columns from ancestor to child #51

wuzhiji37 opened this issue May 19, 2017 · 2 comments

Comments

@wuzhiji37
Copy link

this.columns = [
      {
        name: 'ancestor',
        options: [
          { text: '1', value: '1' },
          { text: '2', value: '2' }
        ]
      },
      {
        name: 'parent',
        parentCol: 'ancestor',
        options: [
          { text: '1-1', value: '1-1', parentVal: '1' },
          { text: '1-2', value: '1-2', parentVal: '1' },
          { text: '2-1', value: '2-1', parentVal: '2' },
          { text: '2-2', value: '2-2', parentVal: '2' },
        ]
      },
      {
        name: 'child',
        parentCol: 'parent',
        options: [
          { text: '1-1-1', value: '1-1-1', parentVal: '1-1' },
          { text: '1-1-2', value: '1-1-2', parentVal: '1-1' },
          { text: '1-2-1', value: '1-2-1', parentVal: '1-2' },
          { text: '1-2-2', value: '1-2-2', parentVal: '1-2' },
          { text: '2-1-1', value: '2-1-1', parentVal: '2-1' },
          { text: '2-1-2', value: '2-1-2', parentVal: '2-1' },
          { text: '2-2-1', value: '2-2-1', parentVal: '2-2' },
          { text: '2-2-2', value: '2-2-2', parentVal: '2-2' }
        ]
      }
    ];

the example is ok in my project;
then,I change the example to this, and it doesn't work like example.

@raychenfj
Copy link
Owner

raychenfj commented May 19, 2017

@wuzhiji37
Thanks, there is actually a bug!!!

Temporary workarounds are:

  1. Forget About the parentCol, default its order is from left to right

  2. Or try to add another attribute alias, and give it the same value as parentCol

     {
        name: 'child',
        parentCol: 'parent',
        alias: 'parent',
        ...    
      }

@wuzhiji37
Copy link
Author

thank you!
I use the solution 1 and it works

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants