Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>You can use angular to bind to the <code>filterOptions.filterText</code> variable. There's a plunker here to demonstrate: <a href="http://plnkr.co/edit/PHdBhF?p=preview" rel="noreferrer">http://plnkr.co/edit/PHdBhF?p=preview</a></p> <p>I'll post the same code below:</p> <pre><code> // main.js var app = angular.module('myApp', ['ngGrid']); app.controller('MyCtrl', function($scope) { $scope.filterOptions = { filterText: '' }; $scope.myData = [{name: "Moroni", age: 50}, {name: "Tiancum", age: 43}, {name: "Jacob", age: 27}, {name: "Nephi", age: 29}, {name: "Enos", age: 34}]; $scope.gridOptions = { data: 'myData', filterOptions: $scope.filterOptions }; }); </code></pre> <p>The above should be about identical to the plunkers on the docs page.</p> <pre><code> &lt;!DOCTYPE html&gt; &lt;html ng-app="myApp"&gt; &lt;head lang="en"&gt; &lt;meta charset="utf-8"&gt; &lt;title&gt;Custom Plunker&lt;/title&gt; &lt;link href="//netdna.bootstrapcdn.com/twitter-bootstrap/2.3.1/css/bootstrap-combined.min.css" rel="stylesheet"&gt; &lt;link rel="stylesheet" type="text/css" href="http://angular-ui.github.com/ng-grid/css/ng-grid.css" /&gt; &lt;link rel="stylesheet" type="text/css" href="style.css" /&gt; &lt;script src="https://ajax.googleapis.com/ajax/libs/jquery/1.8.0/jquery.min.js"&gt;&lt;/script&gt; &lt;script src="//netdna.bootstrapcdn.com/twitter-bootstrap/2.3.1/js/bootstrap.min.js"&gt;&lt;/script&gt; &lt;script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.0.2/angular.min.js"&gt;&lt;/script&gt; &lt;script type="text/javascript" src="http://angular-ui.github.com/ng-grid/lib/ng-grid.debug.js"&gt;&lt;/script&gt; &lt;script type="text/javascript" src="main.js"&gt;&lt;/script&gt; &lt;/head&gt; &lt;body ng-controller="MyCtrl"&gt; &lt;strong&gt;Filter:&lt;/strong&gt;&lt;input type="text" ng-model="filterOptions.filterText" /&gt; &lt;br/&gt; &lt;br/&gt; &lt;div class="gridStyle" ng-grid="gridOptions"&gt;&lt;/div&gt; &lt;/body&gt; &lt;/html&gt; </code></pre> <p>Notice <code>ng-model="filterOptions.filterText"</code> on the <code>&lt;input ...&gt;</code>. That's all it takes!</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload