Skip to content
This repository has been archived by the owner on Dec 7, 2019. It is now read-only.

Custom Input field for search #38

Open
ghost opened this issue Jun 8, 2018 · 3 comments
Open

Custom Input field for search #38

ghost opened this issue Jun 8, 2018 · 3 comments
Labels

Comments

@ghost
Copy link

ghost commented Jun 8, 2018

Hi,

how can i use a custom input field that trigger the search for available nodes?

@elbywan
Copy link
Owner

elbywan commented Jun 10, 2018

Hi @SgtPepper27,

how can i use a custom input field that trigger the search for available nodes?

If by "custom" you mean that you don't want to use the search prop then you can simply filter the model (a simple tree of elements) according to the user input yourself before passing it to bosket.

@ghost
Copy link
Author

ghost commented Jun 11, 2018

The only problem i still have is, after filtering the model, that every time the hole tree fold up so i have to open it again after every search. How can I achieve this that he remains opened.

Btw. I would like to open the first Node of my tree automatically. Is there an options for this?

@elbywan
Copy link
Owner

elbywan commented Jun 12, 2018

How can I achieve this that he remains opened.

You can solve this issue by defining your own fold strategy (on top of the existing ones).

Something like:

function (item) {
   return myCustomInputIsUsed // true means every item will be unfolded
}

Btw. I would like to open the first Node of my tree automatically. Is there an options for this?

There is a max-depth fold strategy.

You can use it like this by passing a maxDepth={1} prop to the bosket component.

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

No branches or pull requests

1 participant