-
Notifications
You must be signed in to change notification settings - Fork 81
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
[Proposal]: Add default sort to KTable #772
Comments
Thanks @BabyElias! (1) When I looked at (2) Imagining using Putting it together, maybe something like
??? This is not meant to be conclusion. Just feedback based on my first thoughts - we can build on top of it or perhaps it will help to spark some alternative ideas. Glad to discuss. Let's see if we can also hear from others. |
The second approach using headers has also been my personal preference. It's more intuitive and easier to configure that way. |
Something against the second option is What happen if the consumer sends multiple headers with the For this, having a separate prop sets the right restrictions, as we can set just one column to be sorted, and if in the future we want to include sorting by multiple columns, we will need just to change this prop from expecting an object to expecting an array of objects like [key1 ASC, key2 DESC, key3 ASC] (similar to the orderBy statemnt in SQL), where its easier to identify which column has more priority, and is less prominent to errors. Something that could have more chance of happening is what if in the future we would want to store the sorting preferences of the user? In that case we would need to store an object similar to the one in the first option, so having this key like that will be easier to just pass this stored object in that case. Something against of the first option (although we already kind of dicuss about it) is that we will need to have an With this, I would have a slight preference towards the first option but with some modifications to something like: <KTable
:headers="headers"
:rows="rows"
caption="Table with built-in sorting"
sortable
:defaultSort="{ headerId: 'fullName', sort: 'asc' }"
/> This is not mean to be a conclusion either, I would like to know what you think about the approach and see the advantages and disadvantages of each pattern and decide based on that. |
Thank you @AlexVelezLl, I think these are too good considerations. |
Another idea - over time we will also see better what other configuration options we need to add to the table (there's potential for many) and consider if configuring via possible Based on the feedback from the team, I'm preparing |
This didn't go that well as I expected. For more reasons, to the best of my knowledge at this point (discussed internally), I'd rather avoid using composable for initial configuration of a component. So I think I would lean towards one of the options in @BabyElias's original proposal and @AlexVelezLl 's suggestion:
|
It seems we arrived at agreement here. I didn't want to overwrite the proposal issue so all the discussion doesn't lose valuable context, so I've opened a new final issue out of this proposal here #794, and specified the feature in more detail on that opportunity. Thanks @BabyElias and @AlexVelezLl :) |
Product
KDS
Description :
We plan to include a feature in KTable that will allow the table to be sorted by default based on any column when initially loaded.
For eg :
Desired behavior
In order to implement this, we propose two ways of configuring the API. Not sure, which one would actually be more suited from a user perspective :
headers
, something like :The text was updated successfully, but these errors were encountered: