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

doc(multiselect): Fix Select All checkbox click #1406

Merged
merged 1 commit into from
Apr 25, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 12 additions & 9 deletions knowledge-base/multiselect-checkbox-in-dropdown.md
Original file line number Diff line number Diff line change
Expand Up @@ -91,37 +91,40 @@ You can add a "Select All" feature through the `HeaderTemplate` - it only has to
AutoClose="false"
Placeholder="Write the roles you need">
<HeaderTemplate>
<label class="select-all-item">
<div class="select-all-item">
<TelerikCheckBox TValue="bool"
Value="@IsAllSelected()"
ValueChanged="@( (bool v) => ToggleSelectAll(v) )">
ValueChanged="@( (bool v) => ToggleSelectAll(v) )"
Id="ms-select-all-checkbox">
</TelerikCheckBox>
&nbsp;Select All
</label>
<label for="ms-select-all-checkbox">&nbsp;Select All</label>
</div>
</HeaderTemplate>
<ItemTemplate>
<input type="checkbox"
id="@( "cb" + context.Replace(" ", "") )"
class="k-checkbox k-checkbox-md"
checked="@GetChecked(context)">
<label class="k-checkbox-label"
for="@( "cb" + context.Replace(" ", "") )">
@context
</label>
@context
</ItemTemplate>

</TelerikMultiSelect>

<style>
.select-all-item {
padding: 4px 8px;
display: block;
display: flex;
cursor: pointer;
}

.select-all-item:hover {
background: rgba(0, 0, 0, 0.06);
}
.select-all-item label {
display: block;
flex: 1 1 auto;
cursor: pointer;
}
</style>

@foreach (var item in TheValues)
Expand Down