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

Persist child selector when selected parent has changed #15

Open
rapee opened this issue Jun 26, 2013 · 0 comments
Open

Persist child selector when selected parent has changed #15

rapee opened this issue Jun 26, 2013 · 0 comments
Milestone

Comments

@rapee
Copy link
Owner

rapee commented Jun 26, 2013

Data with the same data structure often be kept linearly in an array or object.
And when looking at such data, people tend to move from one to the next item and compare the difference.

For example, when user select data[0].properties.coords, he will see 3 panes.
And then he select data[1]. Instead of showing only 2 panes (data[1] and data[1].properties), it would make much better sense if the third pane kept opened, as one would select data[1].properties.coords.

Note that it makes sense only if those data has the same data structure.

var data = [
  {
    name: 'Bangkok',
    properties: {
      time: '+0700',
      coords: '15 00 N, 100 00 E'
    }
  },
  {
    name: 'Tokyo',
    properties: {
      time: '+0900',
      coords: '36 00 N, 138 00 E'
    }
  }
];

Psuedocode

On select item
  prev <= previous selected item
  cur <= newly selected item
  parent <= first common parent to prev and cur
  prev_base <= path to prev with parent and next level component removed
  if (cur + prev_base) exists
    focus cur + prev item with cur selected
  else
    focus and select cur
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant