# Wijmo_Angular_Grid_Detail.Wjflexgriddetail

## Content

<div class="content__tsd">
						<div style="display:flex;justify-content:space-between;align-items:center">
							<h1>
								WjFlexGridDetail Class
							</h1>
						</div>
						<section class="tsd-comment">
							<div class="tsd-comment">
								<div class="lead">
									<p>AngularJS directive for <a href="wijmo_grid.flexgrid.html">FlexGrid</a> <a href="wijmo_grid_detail.detailrow.html">DetailRow</a> templates.</p>
								</div>
								<p>The <b>wj-flex-grid-detail</b> directive must be contained in a
								<b>wj-flex-grid</b> directive.</p>
								<p>The <b>wj-flex-grid-detail</b> directive represents a <a href="wijmo_grid_detail.flexgriddetailprovider.html">FlexGridDetailProvider</a>
									object that maintains detail rows visibility, with detail rows content defined as
									an arbitrary HTML fragment within the directive tag. The fragment may contain
									AngularJS bindings and directives.
									In addition to any properties available in a controller, the local <b>$row</b> and
									<b>$item</b> template variables can be used in AngularJS bindings that refer to
								the detail row's parent <a href="../enums/wijmo_grid.selectionmode.html#row">Row</a> and <b>Row.dataItem</b> objects. For example:</p>
								<pre>&lt;p&gt;Here is a detail row with a nested FlexGrid:&lt;/p&gt;
&nbsp;
&lt;wj-flex-grid
  items-source="categories"&gt;
  &lt;wj-flex-grid-column header="Name" binding="CategoryName"&gt;&lt;/wj-flex-grid-column&gt;
  &lt;wj-flex-grid-column header="Description" binding="Description" width="*"&gt;&lt;/wj-flex-grid-column&gt;
  &lt;wj-flex-grid-detail max-height="250" detail-visibility-mode="detailMode"&gt;
    &lt;wj-flex-grid
      items-source="getProducts($item.CategoryID)"
      headers-visibility="Column"&gt;
    &lt;/wj-flex-grid&gt;
  &lt;/wj-flex-grid-detail&gt;
&lt;/wj-flex-grid&gt;</pre>
								<p>A reference to a <b>FlexGridDetailProvider</b> object represented by the
									<b>wj-flex-grid-detail</b> directive can be retrieved in a usual way by binding
									to the directive's <b>control</b> property. This makes all the API provided by
									<b>FlexGridDetailProvider</b> available for usage in the template, giving you total
									control over the user experience. The following example adds a custom show/hide toggle
									to the Name column cells, and a Hide Detail button to the detail row. These elements call
									the <b>FlexGridDetailProvider</b>, <b>hideDetail</b> and <b>showDetail</b> methods in
								their <b>ng-click</b> bindings to implement the custom show/hide logic:</p>
								<pre>&lt;p&gt;Here is a FlexGrid with custom show/hide detail elements:&lt;/p&gt;
&nbsp;
&lt;wj-flex-grid
  items-source="categories"
  headers-visibility="Column"
  selection-mode="Row"&gt;
  &lt;wj-flex-grid-column header="Name" binding="CategoryName" is-read-only="true" width="200"&gt;
    &lt;img ng-show="dp.isDetailVisible($row)" ng-click="dp.hideDetail($row)" src="resources/hide.png" /&gt;
    &lt;img ng-hide="dp.isDetailVisible($row)" ng-click="dp.showDetail($row, true)" src="resources/show.png" /&gt;
    {​{$item.CategoryName}}
  &lt;/wj-flex-grid-column&gt;
  &lt;wj-flex-grid-column header="Description" binding="Description" width="2*"&gt;&lt;/wj-flex-grid-column&gt;
  &lt;wj-flex-grid-detail control="dp" detail-visibility-mode="Code"&gt;
    &lt;div style="padding:12px;background-color:#cee6f7"&gt;
      ID: &lt;b&gt;{​{$item.CategoryID}}&lt;/b&gt;&lt;br /&gt;
      Name: &lt;b&gt;{​{$item.CategoryName}}&lt;/b&gt;&lt;br /&gt;
      Description: &lt;b&gt;{​{$item.Description}}&lt;/b&gt;&lt;br /&gt;
      &lt;button class="btn btn-default" ng-click="dp.hideDetail($row)"&gt;Hide Detail&lt;/button&gt;
    &lt;/div&gt;
  &lt;/wj-flex-grid-detail&gt;
&lt;/wj-flex-grid&gt;</pre>
								<p>The <b>wj-flex-grid-detail</b> directive supports the following attributes:</p>
								<dl class="dl-horizontal">
									<dt>control</dt>                <dd><code>=</code> A reference to the <a href="wijmo_grid_detail.flexgriddetailprovider.html">FlexGridDetailProvider</a> object
									created by this directive.</dd>
									<dt>detail-visibility-mode</dt> <dd><code>@</code>A <a href="../enums/wijmo_grid_detail.detailvisibilitymode.html">DetailVisibilityMode</a> value that determines when
									to display the row details.</dd>
									<dt>max-height</dt>             <dd><code>@</code>The maximum height of the detail rows, in pixels.</dd>
									<dt>row-has-detail</dt>         <dd><code>=</code>The callback function that determines whether a row
									has details.</dd>
								</dl>
							</div>
						</section>
						<section class="tsd-hierarchy">
							<h3>Heirarchy</h3>
							<ul class="tsd-hierarchy">
								<li>
									<span class="tsd-signature-type">WjDirective</span>
									<ul class="tsd-hierarchy">
										<li>
											<span class="target">WjFlexGridDetail</span>
										</li>
									</ul>
								</li>
							</ul>
						</section>
					</div>