# wjStyle Class

## Content

<div class="content__tsd">
						<div style="display:flex;justify-content:space-between;align-items:center">
							<h1>
								wjStyle Class
							</h1>
						</div>
						<section class="tsd-comment">
							<div class="tsd-comment">
								<div class="lead">
									<p>KnockoutJS binding for conditional formatting of <a href="wijmo_grid.flexgrid.html">FlexGrid</a> <a href="wijmo_grid.column.html">Column</a> cells.</p>
								</div>
								<p>Use the <a href="wijmo_knockout_grid.wjstyle.html">wjStyle</a> binding together with the <a href="wijmo_knockout_grid.wjflexgridcolumn.html">wjFlexGridColumn</a> binding to provide
									conditional formatting to column cells.
								For example:</p>
								<pre>&lt;div data-bind="wjFlexGridColumn: {
        header: 'Change',
        binding: 'changePercent',
        format: 'p2',
        width: '*'
        },
        wjStyle: { color: getAmountColor($item().change) }"&gt;&lt;/div&gt;</pre>
								<p>The <b>wjStyle</b> uses the same syntax as the native KnockoutJS
									<a href="https://knockoutjs.com/documentation/style-binding.html" target="_blank">style</a> binding.
									In addition to the view model properties, the following observable variables are available in binding
								expressions:</p>
								<dl class="dl-horizontal">
									<dt>$item</dt>  <dd>References the item that is bound to the current row.</dd>
									<dt>$row</dt>  <dd>The row index.</dd>
									<dt>$col</dt>  <dd>The column index.</dd>
								</dl>
							</div>
						</section>
						<section class="tsd-hierarchy">
							<h3>Heirarchy</h3>
							<ul class="tsd-hierarchy">
								<li>
									<span class="target">wjStyle</span>
								</li>
							</ul>
						</section>
					</div>