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

Disable item in DropdownList #5308

Closed
raavikr12c opened this issue Feb 12, 2024 · 4 comments · Fixed by #5317
Closed

Disable item in DropdownList #5308

raavikr12c opened this issue Feb 12, 2024 · 4 comments · Fixed by #5317
Assignees
Labels
Type: Feature ⚙ Request or idea for a new feature.
Milestone

Comments

@raavikr12c
Copy link

raavikr12c commented Feb 12, 2024

Is there a way to disable specific items in dropdownlist? For example: I created a dropdownlist which has 3 options. If i click on one of the item some action will take place via my api and then that option should be disabled in the dropdownlist until i do some other action to enable it. Basically i want to communicate to user that you had already pressed this button and its action is done so you cannot repeat the action you just did by clicking on the same list item.
I checked documentation but didn't find anything so asking it here.
Also is there another way or a better way to achieve the same behavior i am looking for?

This is the code I am working with:

<TableRowCell>
    <Addons Style="background:inherit">
        <Addon AddonType="AddonType.Start">
            <Button>Items</Button>
        </Addon>
        <Addon AddonType="AddonType.Body">
            <DropdownList Data="@itemList"
                          TextField="@((item) => item.Description)"
                          ValueField="@((item) => item.ID)"
                          SelectedValue="@selectedItem"
                          SelectedValueChanged="@OnItemValueChanged"
                          TItem="Item"
                          TValue="object"
                          Direction="Direction.Up">
            </DropdownList>
        </Addon>
    </Addons>
</TableRowCell>
@David-Moreira
Copy link
Contributor

Unfortunately the DropdownList does not support disabling specific items at this time.
However the underlying Dropdown components do.
So my recommendation for now is to create the Dropdown list manually by using the Dropdown DropdownToggle DropdownMenu And DropdownItem to create your dropdown list manually, and then control the disabled state in each of the DropdownItem.


We'll be considering this as a feature for the next release as it's relatively simple to implement.
We'll be implementing a new Parameter similar to the ListView DisabledItem Func:
image

@David-Moreira David-Moreira added the Type: Feature ⚙ Request or idea for a new feature. label Feb 15, 2024
@David-Moreira David-Moreira added this to the 1.5 milestone Feb 15, 2024
@raavikr12c
Copy link
Author

@David-Moreira thanks for the info. I will wait for this feature. Any expected date for 1.5 release?

@David-Moreira
Copy link
Contributor

@David-Moreira thanks for the info. I will wait for this feature. Any expected date for 1.5 release?

I believe it's expected by the end of March. @stsrki ?

@stsrki
Copy link
Collaborator

stsrki commented Feb 16, 2024

Sometimes in March. We still have a few outstanding issues open.

@David-Moreira David-Moreira linked a pull request Feb 17, 2024 that will close this issue
@stsrki stsrki mentioned this issue Feb 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Feature ⚙ Request or idea for a new feature.
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

3 participants