Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
MARKET-1466 Cascade Select #184
base: main
Are you sure you want to change the base?
MARKET-1466 Cascade Select #184
Changes from 8 commits
fba6398
c374578
8314f6e
3bf0e3e
022fb51
95a4a7d
c1ffbc2
17372be
998d639
adbe54c
b5e1786
dc27d5d
557a11b
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How about add an actions same as for default select?
Set Options
Get Options
Set Value
Get Value
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please describe these actions here in the doc
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
detectCircular
?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
could you please explain the logic around
++/-- levelOfNesting
if it needs to calculate nesting depth would not it be better to pass a new level into the
prepare
function?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As far as I understand, with this implementation, we will not be able to get the last depth value when this recursion ends. It's needed to get max depth
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why do you need to know about the max depth?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
get sorted and separated array of
parentItems
bylevelOfNesting
in thegetNestedItems
functionThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
in order to avoid modifying the entire state each time I can propose the following approach:
having a data structure of the list as described here https://github.com/Backendless/ui-builder-library/pull/184/files#r1095517200 you can build a specific
path
for each item, for ex:parent1.child1
in the view you can determine if the leaf/branch must be open by comparing
selectedItem.path.startsWith(theViewItem.path)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what's the difference between them?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
itemsCascade
is a validated object which comes from propertycascade
parentItems
is the array of arrays of parent items(items which have children) separated bylevelOfNesting
items
is the array of items which we can select(which haven't children)There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I still do not understand why we need 3 lists instead of a single one
itemsCascade
we can validate/transform the source list into a list that suits all needs, the target list can have any structure we need and items can have all necessary information about
clickable/nestingLevel/etc
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
because it's easy to find items in an array, instead of an array of objects that have in turn, have their own array of objects
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
parent reference should solve that problem
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
cn('bl-cascadeSelect-component', classList)