带有燃料的julazor:选择组件 / selectItem带删除按钮?
对于我的应用程序,我需要A select - 组件,其中我从不同来源收集了一些用户选择的值。但是用户应该能够以与添加一样简单的方式再次删除值。最好的方法是带有少量按钮或Clickable 徽章的SelectItem 从列表中删除值。但是无论我尝试什么,什么都没有可行,可以看到按钮/徽章,但是单击它是可以忽略的:
<Select TValue="int" Multiple SelectedValues="_selectedWordsForChart" SelectedValuesChanged="@OnSelectedWordsForChartChanged">
@foreach (var word in _selectedCaseWords)
{
<SelectItem Value="@word.WordId"> @word.Word <Button Clicked="@OnButtonClicked">Click me</Button></SelectItem>
}
</Select>
是否有可能实现,我想要的东西,使用 select 组件?如果是,怎么样?我可以更改点击事件的优先级,具体取决于我是否单击此按钮或在 selectItem 的其他区域?如果没有,我应该使用什么组件来使事情正常工作?我认为, select 之外的删除 - 按钮会导致误解,应该删除哪些条目。
我认为使用数据杂志可以符合我的要求,但这似乎有点……对我来说太大了。
For my application I need a Select-Component, where I collect some values the user choosed from different sources. But the user should be able to delete values again in the same easy way like adding. The best way would be a SelectItem with a little Button or clickable Badge to delete the value from the list. But whatever I try, nothing works, the Button/Badge is visible, but a click on it is ignored:
<Select TValue="int" Multiple SelectedValues="_selectedWordsForChart" SelectedValuesChanged="@OnSelectedWordsForChartChanged">
@foreach (var word in _selectedCaseWords)
{
<SelectItem Value="@word.WordId"> @word.Word <Button Clicked="@OnButtonClicked">Click me</Button></SelectItem>
}
</Select>
Is it even possible to achieve, what I want, with the Select Component? If yes, how? Can I change the priority of a clicking event, depending if I click on this Button or at the other area of the SelectItem? And if not, what component should I use to get things working? I think, a Delete-Button outside the Select would lead to misunderstandings, what entries should be deleted.
I assume with a datagrid I can match my requirements, but that seems a little ... oversized to me.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
Blazorise Select Select组件生成简单
&lt; select&gt;
and&lt; option&gt;
html标签。&lt; option&gt;
标签不能包含任何其他标签。因此,无法在SelectItem中添加按钮或徽章。您必须使用不同的燃烧组件可能listView
才能实现您的目标。Blazorise Select component generates simple
<select>
and<option>
html tags.<option>
tag cannot contain any other tags. So it's not possible to add buttons or badges inside the SelectItem. You have to use a different Blazorise component maybeListView
to achieve your goal.