# Wijmo_Grid_Selector.Selector

## Content

<div class="content__tsd">
						<div style="display:flex;justify-content:space-between;align-items:center">
							<h1>
								Selector Class
							</h1>
						</div>
						<section class="tsd-comment">
							<div class="tsd-comment">
								<div class="lead">
									<p>Class that modifies a <a href="wijmo_grid.flexgrid.html">FlexGrid</a> <a href="wijmo_grid.column.html">Column</a> by adding checkboxes
									that can be used to select or de-select rows and groups.</p>
								</div>
								<p>The <a href="wijmo_grid.flexgrid.html">FlexGrid</a> has a <a href="wijmo_grid.flexgrid.html#selectionmode">FlexGrid.selectionMode</a> property that
									allows users to select multiple rows or row ranges using the mouse or the
								keyboard.</p>
								<p>But in some cases you may prefer to provide this functionality by adding
									a column with checkboxes instead. This will allow users to select rows
									easily on mobile devices and may provide a more intuitive interface on
								desktop systems as well.</p>
								<p>The <a href="wijmo_grid_selector.selector.html">Selector</a> class allows you to do this by creating an instance
									of the <a href="wijmo_grid_selector.selector.html">Selector</a> class and setting its <a href="wijmo_grid_selector.selector.html#column">column</a> property to
								the column where you want the checkboxes to appear. For example:</p>
								<pre><code class="language-typescript"><span class="hljs-comment">// add a SelectorColumn to the first row header column</span>
<span class="hljs-keyword">let</span> selector = <span class="hljs-keyword">new</span> SelectorColumn(theGrid, {
    itemChecked: <span class="hljs-function"><span class="hljs-params">()</span> =&gt;</span> showCheckedCount()
});</code></pre>
								<p>This will add checkboxes to cells in the first row header column.
									The checkboxes are bound to each row's <a href="wijmo_grid.row.html#isselected">Row.isSelected</a> property,
								so toggling the checkbox toggles the row's selected state.</p>
								<p>By default, the <a href="wijmo_grid_selector.selector.html">Selector</a> also adds checkboxes to the top
									header cell and to cells in group rows. These cells can be used to
								select or de-select all rows on the grid and on each group.</p>
								<p>You may use the <a href="wijmo_grid_selector.selector.html#showcheckall">showCheckAll</a> property to turn off the checkbox
								at the top header cell.</p>
								<p>The <a href="wijmo_grid_selector.selector.html">Selector</a> can also be added to non header columns.
								For example:</p>
								<pre><code class="language-typescript"><span class="hljs-comment">// add a SelectorColumn to the first row data column</span>
<span class="hljs-keyword">let</span> selector = <span class="hljs-keyword">new</span> SelectorColumn(theGrid.columns[<span class="hljs-number">0</span>], {
    itemChecked: <span class="hljs-function"><span class="hljs-params">()</span> =&gt;</span> showCheckedCount()
});</code></pre>
								<p>In this case, the <a href="wijmo_grid_selector.selector.html">Selector</a> will add the selection checkboxes
								to regular grid cells preserving their original data content.</p>
								<p><strong>Note</strong>: When you attach a <a href="wijmo_grid_selector.selector.html">Selector</a> to a <a href="wijmo_grid.flexgrid.html">FlexGrid</a>,
									it will automatically set the grid's <a href="wijmo_grid.flexgrid.html#selectionmode">FlexGrid.selectionMode</a>
									property to <a href="../enums/wijmo_grid.selectionmode.html#cell">SelectionMode.Cell</a>, since that is the selection
									mode that makes most sense for the type of selection provided by
								the <a href="wijmo_grid_selector.selector.html">Selector</a>.</p>
								<p>The grid's <a href="wijmo_grid.flexgrid.html#selectionmode">FlexGrid.selectionMode</a> should not be set when
									the <a href="wijmo_grid.flexgrid.html">FlexGrid</a> is used with <a href="wijmo_grid_selector.selector.html">Selector</a>. Specifically,
									the grid's <a href="wijmo_grid.flexgrid.html#selectionmode">FlexGrid.selectionMode</a> should not be set to
									<a href="../enums/wijmo_grid.selectionmode.html#listbox">SelectionMode.ListBox</a> as it would cause the grid to interfere
								with the selector's behavior.</p>
								<p>The grid's <a href="wijmo_grid.flexgrid.html#selectionmode">FlexGrid.selectionMode</a> can be set to any <a href="../enums/wijmo_grid.selectionmode.html">SelectionMode</a>
								except the <a href="../enums/wijmo_grid.selectionmode.html#listbox">SelectionMode.ListBox</a> without any issue if required.</p>
								<p>The following code would cause the issue.</p>
								<pre><code class="language-typescript"><span class="hljs-keyword">let</span> selector = <span class="hljs-keyword">new</span> SelectorColumn(theGrid.columns[<span class="hljs-number">0</span>], {
    itemChecked: <span class="hljs-function"><span class="hljs-params">()</span> =&gt;</span> showCheckedCount()
});
<span class="hljs-comment">// set the SelectionMode</span>
theGrid.selectionMode = SelectionMode.ListBox;</code></pre>
								<p>In above code-snippet, setting the SelectionMode to ListBox after
								attaching the Selector to FlexGrid, would cause the interference.</p>
								<p>As the ListBox selectionMode, uses the <a href="wijmo_grid.row.html#isselected">Row.isSelected</a> and
									the Selector also uses the <a href="wijmo_grid.row.html#isselected">Row.isSelected</a>.
									Hence, the grid's selectionMode to ListBox with Selector, would cause
								the incorrect selection of rows issue.</p>
							</div>
						</section>
						<section class="tsd-hierarchy">
							<h3>Heirarchy</h3>
							<ul class="tsd-hierarchy">
								<li>
									<span class="target">Selector</span>
									<ul class="tsd-hierarchy">
										<li>
											<a href="wijmo_grid_selector.booleanchecker.html" class="tsd-signature-type">BooleanChecker</a>
										</li>
									</ul>
								</li>
							</ul>
						</section>
						<section class="tsd-index-group">
							<section class="tsd-index-panel">
								<div class="tsd-index-content">
									<section class="tsd-index-section ">
										<div class="title">
											<div class="gc_api_tree-item_icon_img_wrapper">
												<div class="gc_api_tree-item_icon_img" data-expand="true">
												</div>
											</div>
											<h3>
												Constructors
											</h3>
										</div>
										<ul class="tsd-index-list">
											<li class="tsd-kind-constructor tsd-parent-kind-class"><a href="wijmo_grid_selector.selector.html#constructor" class="tsd-kind-icon">constructor</a></li>
										</ul>
									</section>
									<section class="tsd-index-section ">
										<div class="title">
											<div class="gc_api_tree-item_icon_img_wrapper">
												<div class="gc_api_tree-item_icon_img" data-expand="true">
												</div>
											</div>
											<h3>
												Properties
											</h3>
										</div>
										<ul class="tsd-index-list">
											<li class="tsd-kind-property tsd-parent-kind-class"><a href="wijmo_grid_selector.selector.html#arialabel" class="tsd-kind-icon">aria<wbr>Label</a></li>
											<li class="tsd-kind-property tsd-parent-kind-class"><a href="wijmo_grid_selector.selector.html#column" class="tsd-kind-icon">column</a></li>
											<li class="tsd-kind-property tsd-parent-kind-class"><a href="wijmo_grid_selector.selector.html#showcheckall" class="tsd-kind-icon">show<wbr>Check<wbr>All</a></li>
										</ul>
									</section>
									<section class="tsd-index-section ">
										<div class="title">
											<div class="gc_api_tree-item_icon_img_wrapper">
												<div class="gc_api_tree-item_icon_img" data-expand="true">
												</div>
											</div>
											<h3>
												Methods
											</h3>
										</div>
										<ul class="tsd-index-list">
											<li class="tsd-kind-method tsd-parent-kind-class"><a href="wijmo_grid_selector.selector.html#oncolumnchanged" class="tsd-kind-icon">on<wbr>Column<wbr>Changed</a></li>
											<li class="tsd-kind-method tsd-parent-kind-class"><a href="wijmo_grid_selector.selector.html#oncolumnchanging" class="tsd-kind-icon">on<wbr>Column<wbr>Changing</a></li>
											<li class="tsd-kind-method tsd-parent-kind-class"><a href="wijmo_grid_selector.selector.html#onitemchecked" class="tsd-kind-icon">on<wbr>Item<wbr>Checked</a></li>
										</ul>
									</section>
									<section class="tsd-index-section ">
										<div class="title">
											<div class="gc_api_tree-item_icon_img_wrapper">
												<div class="gc_api_tree-item_icon_img" data-expand="true">
												</div>
											</div>
											<h3>
												Events
											</h3>
										</div>
										<ul class="tsd-index-list">
											<li class="tsd-kind-event tsd-parent-kind-class"><a href="wijmo_grid_selector.selector.html#columnchanged" class="tsd-kind-icon">column<wbr>Changed</a></li>
											<li class="tsd-kind-event tsd-parent-kind-class"><a href="wijmo_grid_selector.selector.html#columnchanging" class="tsd-kind-icon">column<wbr>Changing</a></li>
											<li class="tsd-kind-event tsd-parent-kind-class"><a href="wijmo_grid_selector.selector.html#itemchecked" class="tsd-kind-icon">item<wbr>Checked</a></li>
										</ul>
									</section>
								</div>
							</section>
						</section>
						<section class="tsd-panel-group tsd-member-group ">
							<h2>Constructors</h2>
							<section class="tsd-panel tsd-member tsd-kind-constructor tsd-parent-kind-class">
								<a name="constructor" class="tsd-anchor"></a>
								<h3>constructor</h3>
								<ul class="tsd-signatures tsd-kind-constructor tsd-parent-kind-class">
									<li class="tsd-signature tsd-kind-icon">new <wbr>Selector<span class="tsd-signature-symbol">(</span>column<span class="tsd-signature-symbol">?: </span><a href="wijmo_grid.column.html" class="tsd-signature-type">Column</a><span class="tsd-signature-symbol"> | </span><a href="wijmo_grid.flexgrid.html" class="tsd-signature-type">FlexGrid</a>, options<span class="tsd-signature-symbol">?: </span><span class="tsd-signature-type">any</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><a href="wijmo_grid_selector.selector.html" class="tsd-signature-type">Selector</a></li>
								</ul>
								<ul class="tsd-descriptions">
									<li class="tsd-description">
										<aside class="tsd-sources">
										</aside>
										<div class="tsd-comment">
											<div class="lead">
												<p>Initializes a new instance of the <a href="wijmo_grid_selector.selector.html">Selector</a> class.</p>
											</div>
										</div>
										<h4 class="tsd-parameters-title">Parameters</h4>
										<ul class="tsd-parameters">
											<li>
												<h5><span class="tsd-flag ts-flagOptional">Optional</span> column: <a href="wijmo_grid.column.html" class="tsd-signature-type">Column</a><span class="tsd-signature-symbol"> | </span><a href="wijmo_grid.flexgrid.html" class="tsd-signature-type">FlexGrid</a></h5>
												<div class="tsd-comment">
													<div class="lead">
														<p>The <a href="wijmo_grid.column.html">Column</a> that this <a href="wijmo_grid_selector.selector.html">Selector</a> should customize,
														or a reference to a <a href="wijmo_grid.flexgrid.html">FlexGrid</a> whose first column will be customized.</p>
													</div>
												</div>
											</li>
											<li>
												<h5><span class="tsd-flag ts-flagOptional">Optional</span> options: <span class="tsd-signature-type">any</span></h5>
												<div class="tsd-comment">
													<div class="lead">
														<p>An object containing initialization data for the object.</p>
													</div>
												</div>
											</li>
										</ul>
										<h4 class="tsd-returns-title">Returns <a href="wijmo_grid_selector.selector.html" class="tsd-signature-type">Selector</a></h4>
									</li>
								</ul>
							</section>
						</section>
						<section class="tsd-panel-group tsd-member-group ">
							<h2>Properties</h2>
							<section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-class">
								<a name="arialabel" class="tsd-anchor"></a>
								<h3>ariaLabel</h3>
								<div class="tsd-signature tsd-kind-icon">aria<wbr>Label<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span></div>
								<aside class="tsd-sources">
								</aside>
								<div class="tsd-comment">
									<div class="lead">
										<p> Gets or sets the  aria label property of selector.</p>
									</div>
									<p>The default value for this property is <strong>''</strong>.</p>
								</div>
							</section>
							<section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-class">
								<a name="column" class="tsd-anchor"></a>
								<h3>column</h3>
								<div class="tsd-signature tsd-kind-icon">column<span class="tsd-signature-symbol">:</span> <a href="wijmo_grid.column.html" class="tsd-signature-type">Column</a><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">null</span></div>
								<aside class="tsd-sources">
								</aside>
								<div class="tsd-comment">
									<div class="lead">
										<p>Gets or sets the <a href="wijmo_grid.column.html">Column</a> to be used by this <a href="wijmo_grid_selector.selector.html">Selector</a>.</p>
									</div>
								</div>
							</section>
							<section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-class">
								<a name="showcheckall" class="tsd-anchor"></a>
								<h3>showCheckAll</h3>
								<div class="tsd-signature tsd-kind-icon">show<wbr>Check<wbr>All<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">boolean</span></div>
								<aside class="tsd-sources">
								</aside>
								<div class="tsd-comment">
									<div class="lead">
										<p>Gets or sets a value that determines whether to show a
										'Check All' items checkbox on the column header.</p>
									</div>
									<p>The default value for this property is <strong>true</strong>.</p>
								</div>
							</section>
						</section>
						<section class="tsd-panel-group tsd-member-group ">
							<h2>Methods</h2>
							<section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-class">
								<a name="oncolumnchanged" class="tsd-anchor"></a>
								<h3>onColumnChanged</h3>
								<ul class="tsd-signatures tsd-kind-method tsd-parent-kind-class">
									<li class="tsd-signature tsd-kind-icon">on<wbr>Column<wbr>Changed<span class="tsd-signature-symbol">(</span>e<span class="tsd-signature-symbol">?: </span><a href="wijmo.eventargs.html" class="tsd-signature-type">EventArgs</a><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">void</span></li>
								</ul>
								<ul class="tsd-descriptions">
									<li class="tsd-description">
										<aside class="tsd-sources">
										</aside>
										<div class="tsd-comment">
											<div class="lead">
												<p>Raises the <a href="wijmo_grid_selector.selector.html#columnchanged">columnChanged</a> event.</p>
											</div>
										</div>
										<h4 class="tsd-parameters-title">Parameters</h4>
										<ul class="tsd-parameters">
											<li>
												<h5><span class="tsd-flag ts-flagOptional">Optional</span> e: <a href="wijmo.eventargs.html" class="tsd-signature-type">EventArgs</a></h5>
											</li>
										</ul>
										<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">void</span></h4>
									</li>
								</ul>
							</section>
							<section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-class">
								<a name="oncolumnchanging" class="tsd-anchor"></a>
								<h3>onColumnChanging</h3>
								<ul class="tsd-signatures tsd-kind-method tsd-parent-kind-class">
									<li class="tsd-signature tsd-kind-icon">on<wbr>Column<wbr>Changing<span class="tsd-signature-symbol">(</span>e<span class="tsd-signature-symbol">: </span><a href="wijmo.canceleventargs.html" class="tsd-signature-type">CancelEventArgs</a><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">boolean</span></li>
								</ul>
								<ul class="tsd-descriptions">
									<li class="tsd-description">
										<aside class="tsd-sources">
										</aside>
										<div class="tsd-comment">
											<div class="lead">
												<p>Raises the <a href="wijmo_grid_selector.selector.html#columnchanging">columnChanging</a> event.</p>
											</div>
										</div>
										<h4 class="tsd-parameters-title">Parameters</h4>
										<ul class="tsd-parameters">
											<li>
												<h5>e: <a href="wijmo.canceleventargs.html" class="tsd-signature-type">CancelEventArgs</a></h5>
												<div class="tsd-comment">
													<p><a href="wijmo.canceleventargs.html">CancelEventArgs</a> that contains the event data.</p>
												</div>
											</li>
										</ul>
										<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">boolean</span></h4>
										<p>True if the event was not canceled.</p>
									</li>
								</ul>
							</section>
							<section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-class">
								<a name="onitemchecked" class="tsd-anchor"></a>
								<h3>onItemChecked</h3>
								<ul class="tsd-signatures tsd-kind-method tsd-parent-kind-class">
									<li class="tsd-signature tsd-kind-icon">on<wbr>Item<wbr>Checked<span class="tsd-signature-symbol">(</span>e<span class="tsd-signature-symbol">?: </span><a href="wijmo.eventargs.html" class="tsd-signature-type">EventArgs</a><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">void</span></li>
								</ul>
								<ul class="tsd-descriptions">
									<li class="tsd-description">
										<aside class="tsd-sources">
										</aside>
										<div class="tsd-comment">
											<div class="lead">
												<p>Raises the <a href="wijmo_grid_selector.selector.html#itemchecked">itemChecked</a> event.</p>
											</div>
										</div>
										<h4 class="tsd-parameters-title">Parameters</h4>
										<ul class="tsd-parameters">
											<li>
												<h5><span class="tsd-flag ts-flagOptional">Optional</span> e: <a href="wijmo.eventargs.html" class="tsd-signature-type">EventArgs</a></h5>
											</li>
										</ul>
										<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">void</span></h4>
									</li>
								</ul>
							</section>
						</section>
						<section class="tsd-panel-group tsd-member-group ">
							<h2>Events</h2>
							<section class="tsd-panel tsd-member tsd-kind-event tsd-parent-kind-class">
								<a name="columnchanged" class="tsd-anchor"></a>
								<h3>columnChanged</h3>
								<div class="tsd-signature tsd-kind-icon">column<wbr>Changed<span class="tsd-signature-symbol">:</span> <a href="wijmo.event.html" class="tsd-signature-type">Event</a><span class="tsd-signature-symbol">&lt;</span><a href="wijmo_grid_selector.selector.html" class="tsd-signature-type">Selector</a><span class="tsd-signature-symbol">, </span><a href="wijmo.eventargs.html" class="tsd-signature-type">EventArgs</a><span class="tsd-signature-symbol">&gt;</span></div>
								<aside class="tsd-sources">
								</aside>
								<div class="tsd-comment">
									<div class="lead">
										<p>Occurs after the value of the <a href="wijmo_grid_selector.selector.html#column">column</a> property changes.</p>
									</div>
								</div>
							</section>
							<section class="tsd-panel tsd-member tsd-kind-event tsd-parent-kind-class">
								<a name="columnchanging" class="tsd-anchor"></a>
								<h3>columnChanging</h3>
								<div class="tsd-signature tsd-kind-icon">column<wbr>Changing<span class="tsd-signature-symbol">:</span> <a href="wijmo.event.html" class="tsd-signature-type">Event</a><span class="tsd-signature-symbol">&lt;</span><a href="wijmo_grid_selector.selector.html" class="tsd-signature-type">Selector</a><span class="tsd-signature-symbol">, </span><a href="wijmo.canceleventargs.html" class="tsd-signature-type">CancelEventArgs</a><span class="tsd-signature-symbol">&gt;</span></div>
								<aside class="tsd-sources">
								</aside>
								<div class="tsd-comment">
									<div class="lead">
										<p>Occurs before the value of the <a href="wijmo_grid_selector.selector.html#column">column</a> property changes.</p>
									</div>
								</div>
							</section>
							<section class="tsd-panel tsd-member tsd-kind-event tsd-parent-kind-class">
								<a name="itemchecked" class="tsd-anchor"></a>
								<h3>itemChecked</h3>
								<div class="tsd-signature tsd-kind-icon">item<wbr>Checked<span class="tsd-signature-symbol">:</span> <a href="wijmo.event.html" class="tsd-signature-type">Event</a><span class="tsd-signature-symbol">&lt;</span><a href="wijmo_grid_selector.selector.html" class="tsd-signature-type">Selector</a><span class="tsd-signature-symbol">, </span><a href="wijmo.eventargs.html" class="tsd-signature-type">EventArgs</a><span class="tsd-signature-symbol">&gt;</span></div>
								<aside class="tsd-sources">
								</aside>
								<div class="tsd-comment">
									<div class="lead">
										<p>Occurs when the user checks an item on this column.</p>
									</div>
								</div>
							</section>
						</section>
					</div>