Skip to content

Commit 92cdf3f

Browse files
committed
gh-pages v3.0.0-rc.20-cb3d301
1 parent 38b798e commit 92cdf3f

26 files changed

+400
-330
lines changed

docs/js/docs-setup.js

+10-10
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/partials/api/design-rendering-cycle.html

+18-2
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,21 @@ <h3 id="current">Current</h4>
4545
<ul><li>may call buildStyles again if it decides headerHeight has changed</li></ul></li></ul></li>
4646
</ul>
4747

48+
<p>The style builders include:</p>
49+
50+
<ul>
51+
<li><code>GridRenderContainer</code>, which appears to currently apply no styles</li>
52+
<li><code>uiGrid.updateColumnWidths</code>, which calculates column widths based on the defined settings, including resolving * and ** etc. No rendering
53+
is involved - all based on the availableWidth. This may be the source of some of the iteration - because availableWidth must in some way be
54+
based on columnWidth - the canvas doesn't really have an available width. I also have question on why we calculate widths on the grid
55+
and not on the renderContainer, that may be another source of iteration. Having said that, things like % and * probably apply to the
56+
full grid width, not to just a container, and we wouldn't expect a column to change width when it changed container (e.g. when we pinned it)</li>
57+
<li><code>uiGridRenderContainer.update()</code>, which is called for each renderContainer. It determines the
58+
width of each column in the render container, and the width of the overall render container.</li>
59+
<li><code>Grid.prototype.getFooterStyles()</code>, sets the columnFooterHeight and the gridFooterHeight based on fixed values declared in the options</li>
60+
<li>when there are multiple renderContainers (e.g. a left container), the non-body render containers appear to execute first</li>
61+
</ul>
62+
4863
<h3 id="vision">Vision</h4>
4964

5065
<p>The vision is to make the style calculations more deterministic, and remove any iteration or other dependencies. A single pass through
@@ -55,9 +70,10 @@ <h3 id="vision">Vision</h4>
5570
<ul>
5671
<li>calculate all sizing in code, without reference to the sizing of rendered grid elements. We already do most of this for rows
5772
and columns, the main gap seems to be grid header</li>
58-
<li>we could reference rendered size to determine the grid's available size (if we want to), which could allow the grid to be more responsive</li>
59-
<li>layout all the columns first - what render container they're in etc, before we start any sizing</li>
73+
<li>we could reference rendered size to determine the grid's available size (if we want to), which could allow the grid to be more
74+
responsive. Probably we already do this.</li>
6075
<li>calculate the column widths and element heights</li>
76+
<li>layout all the columns - what render container they're in etc, then size the render containers</li>
6177
<li>calculate the overall grid sizing based on all the elements (headerHeight, footerHeight, container widths etc)</li>
6278
<li>render</li>
6379
</ul>

docs/partials/tutorial/102_sorting.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ <h3>Source</h3>
3737

3838
<br>
3939
<br>
40-
<button id='toggleGender' ng-click='toggleGender()'>Toggle Gender</button>
40+
<button id='toggleGender' ng-click='toggleGender()' class="btn btn-success" >Toggle Gender</button>
4141
<div id="grid1" ui-grid="gridOptions1" class="grid"></div>
4242

4343
<br>

docs/partials/tutorial/103_filtering.html

+33-3
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,12 @@ <h3 id="multiplefilterfields">Multiple filter fields</h4>
4242

4343
<p>Occasionally, you may want to provide two or more filters for a single column. This can be accomplished by setting a <code>filters</code> array instead of a <code>filter</code> object.
4444
The elements of this array are the same as the contents of the <code>filter</code> object in all the previous examples. In fact, <code>filter: { term: 'xxx' }</code> is just an alias
45-
for <code>filters: [{ term: 'xxx' }]</code>. See the "age" column below for an example.</p><h2 id="Example">Example</h2>
45+
for <code>filters: [{ term: 'xxx' }]</code>. See the "age" column below for an example.</p>
46+
47+
<h3 id="datefilters">Date filters</h4>
48+
49+
<p>The example also includes date filters. These work, however there isn't a date chooser in the filter widget - so you may need to implement a custom field
50+
if you want to filter dates in this way. </p><h2 id="Example">Example</h2>
4651
<div class="example"><h4>Source</h4>
4752
<div source-edit="app" source-edit-deps="angular.js app.js" source-edit-html="index.html-24" source-edit-css="main.css" source-edit-js="app.js" source-edit-unit="" source-edit-scenario="scenario.js-25"></div>
4853
<div class="tabbable"><div class="tab-pane" title="index.html">
@@ -55,6 +60,7 @@ <h3 id="multiplefilterfields">Multiple filter fields</h4>
5560
<strong>Note:</strong> The third column has the filter input disabled, but actually has a filter set in code that requires every company to have an 'a' in their name.
5661
<br>
5762
<br>
63+
<button id='toggleFiltering' ng-click="toggleFiltering()" class="btn btn-success">Toggle Filtering</button>
5864
<div id="grid1" ui-grid="gridOptions" class="grid"></div>
5965
</div>
6066
</script>
@@ -74,8 +80,15 @@ <h3 id="multiplefilterfields">Multiple filter fields</h4>
7480
var app = angular.module('app', ['ngAnimate', 'ngTouch', 'ui.grid']);
7581

7682
app.controller('MainCtrl', ['$scope', '$http', 'uiGridConstants', function ($scope, $http, uiGridConstants) {
83+
var today = new Date();
84+
var nextWeek = new Date();
85+
nextWeek.setDate(nextWeek.getDate() + 7);
86+
7787
$scope.gridOptions = {
7888
enableFiltering: true,
89+
onRegisterApi: function(gridApi){
90+
$scope.gridApi = gridApi;
91+
},
7992
columnDefs: [
8093
// default
8194
{ field: 'name' },
@@ -117,15 +130,31 @@ <h3 id="multiplefilterfields">Multiple filter fields</h4>
117130
condition: uiGridConstants.filter.LESS_THAN,
118131
placeholder: 'less than'
119132
}
120-
]}
133+
]},
134+
// date filter
135+
{ field: 'mixedDate', cellFilter: 'date', width: '15%', filter: {
136+
condition: uiGridConstants.filter.LESS_THAN,
137+
placeholder: 'less than',
138+
term: nextWeek
139+
}}
121140
]
122141
};
123142

124143
$http.get('/data/500_complex.json')
125144
.success(function(data) {
126145
$scope.gridOptions.data = data;
127146
$scope.gridOptions.data[0].age = -5;
147+
148+
data.forEach( function addDates( row, index ){
149+
row.mixedDate = new Date();
150+
row.mixedDate.setDate(today.getDate() + ( index % 14 ) );
151+
});
128152
});
153+
154+
$scope.toggleFiltering = function(){
155+
$scope.gridOptions.enableFiltering = !$scope.gridOptions.enableFiltering;
156+
$scope.gridApi.core.notifyDataChange( uiGridConstants.dataChange.COLUMN );
157+
};
129158
}]);
130159
</script>
131160
</div>
@@ -139,13 +168,14 @@ <h3 id="multiplefilterfields">Multiple filter fields</h4>
139168
gridTestUtils.expectHeaderColumnCount( 'grid1', 6 );
140169
});
141170

142-
it('filter on 4 columns, filter with greater than/less than on one, one with no filter', function () {
171+
it('filter on 4 columns, filter with greater than/less than on one, one with no filter, then one with one filter', function () {
143172
gridTestUtils.expectFilterBoxInColumn( 'grid1', 0, 1 );
144173
gridTestUtils.expectFilterBoxInColumn( 'grid1', 1, 1 );
145174
gridTestUtils.expectFilterBoxInColumn( 'grid1', 2, 0 );
146175
gridTestUtils.expectFilterBoxInColumn( 'grid1', 3, 1 );
147176
gridTestUtils.expectFilterBoxInColumn( 'grid1', 4, 1 );
148177
gridTestUtils.expectFilterBoxInColumn( 'grid1', 5, 2 );
178+
gridTestUtils.expectFilterBoxInColumn( 'grid1', 6, 1 );
149179
});
150180

151181
it('third row should be Hatfield Hudson - will be Terry Clay if filtering broken', function () {

docs/partials/tutorial/301_editableOnFocus.html

+4-4
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,10 @@ <h1><code ng:non-bindable=""></code>
66
<br/>
77
See api docs for default navigation keys and how you can override.</p><h2 id="Example">Example</h2>
88
<div class="example"><h4>Source</h4>
9-
<div source-edit="app" source-edit-deps="angular.js app.js" source-edit-html="index.html-71" source-edit-css="main.css" source-edit-js="app.js" source-edit-unit="" source-edit-scenario=""></div>
9+
<div source-edit="app" source-edit-deps="angular.js app.js" source-edit-html="index.html-70" source-edit-css="main.css" source-edit-js="app.js" source-edit-unit="" source-edit-scenario=""></div>
1010
<div class="tabbable"><div class="tab-pane" title="index.html">
11-
<pre class="prettyprint linenums" ng-set-text="index.html-71" ng-html-wrap-loaded="app angular.js app.js"></pre>
12-
<script type="text/ng-template" id="index.html-71">
11+
<pre class="prettyprint linenums" ng-set-text="index.html-70" ng-html-wrap-loaded="app angular.js app.js"></pre>
12+
<script type="text/ng-template" id="index.html-70">
1313
<div ng-controller="MainCtrl">
1414
<button type="button" class="btn btn-success" ng-click="getCurrentFocus()">Get Current focused cell</button> <span ng-bind="currentFocused"></span>
1515
<br>
@@ -64,5 +64,5 @@ <h1><code ng:non-bindable=""></code>
6464
</script>
6565
</div>
6666
</div><h4>Demo</h4>
67-
<div class="well doc-example-live animator-container" ng-embed-app="app" ng-set-html="index.html-71" ng-eval-javascript="app.js"></div></div>
67+
<div class="well doc-example-live animator-container" ng-embed-app="app" ng-set-html="index.html-70" ng-eval-javascript="app.js"></div></div>
6868
</div>

docs/partials/tutorial/302_custom_header.html

+4-4
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@ <h1><code ng:non-bindable=""></code>
33
</h1>
44
<div><p>Create a grid almost the same as the most basic one, but with a custom header</p><h2 id="Example">Example</h2>
55
<div class="example"><h4>Source</h4>
6-
<div source-edit="app" source-edit-deps="angular.js app.js" source-edit-html="index.html-72 header-template.html" source-edit-css="main.css" source-edit-js="app.js" source-edit-unit="" source-edit-scenario=""></div>
6+
<div source-edit="app" source-edit-deps="angular.js app.js" source-edit-html="index.html-71 header-template.html" source-edit-css="main.css" source-edit-js="app.js" source-edit-unit="" source-edit-scenario=""></div>
77
<div class="tabbable"><div class="tab-pane" title="index.html">
8-
<pre class="prettyprint linenums" ng-set-text="index.html-72" ng-html-wrap-loaded="app angular.js app.js"></pre>
9-
<script type="text/ng-template" id="index.html-72">
8+
<pre class="prettyprint linenums" ng-set-text="index.html-71" ng-html-wrap-loaded="app angular.js app.js"></pre>
9+
<script type="text/ng-template" id="index.html-71">
1010
<div ng-controller="MainCtrl">
1111
<div class="grid" ui-grid="gridOptions"></div>
1212
</div>
@@ -44,5 +44,5 @@ <h1><code ng:non-bindable=""></code>
4444
</script>
4545
</div>
4646
</div><h4>Demo</h4>
47-
<div class="well doc-example-live animator-container" ng-embed-app="app" ng-set-html="index.html-72" ng-eval-javascript="app.js"></div></div>
47+
<div class="well doc-example-live animator-container" ng-embed-app="app" ng-set-html="index.html-71" ng-eval-javascript="app.js"></div></div>
4848
</div>

docs/partials/tutorial/303_customizing_column_menu.html

+6-6
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,10 @@ <h1><code ng:non-bindable=""></code>
2929

3030
<p>See the example below for usage.</p><h2 id="Example">Example</h2>
3131
<div class="example"><h4>Source</h4>
32-
<div source-edit="app" source-edit-deps="angular.js app.js" source-edit-html="index.html-73" source-edit-css="main.css" source-edit-js="app.js" source-edit-unit="" source-edit-scenario="scenario.js-74"></div>
32+
<div source-edit="app" source-edit-deps="angular.js app.js" source-edit-html="index.html-72" source-edit-css="main.css" source-edit-js="app.js" source-edit-unit="" source-edit-scenario="scenario.js-73"></div>
3333
<div class="tabbable"><div class="tab-pane" title="index.html">
34-
<pre class="prettyprint linenums" ng-set-text="index.html-73" ng-html-wrap-loaded="app angular.js app.js"></pre>
35-
<script type="text/ng-template" id="index.html-73">
34+
<pre class="prettyprint linenums" ng-set-text="index.html-72" ng-html-wrap-loaded="app angular.js app.js"></pre>
35+
<script type="text/ng-template" id="index.html-72">
3636
<div ng-controller="MainCtrl">
3737
Click on the third column header to test custom menu items. The first column should have no
3838
column menu available, including via a long-press. The second column should have a menu, but the
@@ -107,8 +107,8 @@ <h1><code ng:non-bindable=""></code>
107107
</script>
108108
</div>
109109
<div class="tab-pane" title="End to end test">
110-
<pre class="prettyprint linenums" ng-set-text="scenario.js-74"></pre>
111-
<script type="text/ng-template" id="scenario.js-74">
110+
<pre class="prettyprint linenums" ng-set-text="scenario.js-73"></pre>
111+
<script type="text/ng-template" id="scenario.js-73">
112112
var gridTestUtils = require('../../test/e2e/gridTestUtils.spec.js');
113113
describe('column menus', function() {
114114
it('grid1 should have three visible columns', function () {
@@ -176,5 +176,5 @@ <h1><code ng:non-bindable=""></code>
176176
</script>
177177
</div>
178178
</div><h4>Demo</h4>
179-
<div class="well doc-example-live animator-container" ng-embed-app="app" ng-set-html="index.html-73" ng-eval-javascript="app.js"></div></div>
179+
<div class="well doc-example-live animator-container" ng-embed-app="app" ng-set-html="index.html-72" ng-eval-javascript="app.js"></div></div>
180180
</div>

docs/partials/tutorial/304_grid_menu.html

+6-6
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,10 @@ <h1><code ng:non-bindable=""></code>
3333
<p>You can suppress the ability to show and hide columns by setting the gridOption <code>gridMenuShowHideColumns: false</code>,
3434
you can suppress the ability to hide individual columns by setting <code>enableHiding</code> on that columnDef to false.</p><h2 id="Example">Example</h2>
3535
<div class="example"><h4>Source</h4>
36-
<div source-edit="app" source-edit-deps="angular.js app.js" source-edit-html="index.html-75" source-edit-css="main.css" source-edit-js="app.js" source-edit-unit="" source-edit-scenario="scenario.js-76"></div>
36+
<div source-edit="app" source-edit-deps="angular.js app.js" source-edit-html="index.html-74" source-edit-css="main.css" source-edit-js="app.js" source-edit-unit="" source-edit-scenario="scenario.js-75"></div>
3737
<div class="tabbable"><div class="tab-pane" title="index.html">
38-
<pre class="prettyprint linenums" ng-set-text="index.html-75" ng-html-wrap-loaded="app angular.js app.js"></pre>
39-
<script type="text/ng-template" id="index.html-75">
38+
<pre class="prettyprint linenums" ng-set-text="index.html-74" ng-html-wrap-loaded="app angular.js app.js"></pre>
39+
<script type="text/ng-template" id="index.html-74">
4040
<div ng-controller="MainCtrl">
4141
<div id="grid1" ui-grid="gridOptions" ui-grid-exporter ui-grid-selection class="grid"></div>
4242
<div ng-if='columnChanged'>
@@ -128,8 +128,8 @@ <h1><code ng:non-bindable=""></code>
128128
</script>
129129
</div>
130130
<div class="tab-pane" title="End to end test">
131-
<pre class="prettyprint linenums" ng-set-text="scenario.js-76"></pre>
132-
<script type="text/ng-template" id="scenario.js-76">
131+
<pre class="prettyprint linenums" ng-set-text="scenario.js-75"></pre>
132+
<script type="text/ng-template" id="scenario.js-75">
133133
var gridTestUtils = require('../../test/e2e/gridTestUtils.spec.js');
134134
describe('grid menu', function() {
135135
it('grid1 should have three visible columns', function () {
@@ -162,5 +162,5 @@ <h1><code ng:non-bindable=""></code>
162162
</script>
163163
</div>
164164
</div><h4>Demo</h4>
165-
<div class="well doc-example-live animator-container" ng-embed-app="app" ng-set-html="index.html-75" ng-eval-javascript="app.js"></div></div>
165+
<div class="well doc-example-live animator-container" ng-embed-app="app" ng-set-html="index.html-74" ng-eval-javascript="app.js"></div></div>
166166
</div>

docs/partials/tutorial/305_appScope.html

+4-4
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,10 @@ <h1><code ng:non-bindable=""></code>
1616
ng-click="grid.appScope.showMe()"
1717
</pre><h2 id="Example">Example</h2>
1818
<div class="example"><h4>Source</h4>
19-
<div source-edit="app" source-edit-deps="angular.js app.js" source-edit-html="index.html-77" source-edit-css="main.css" source-edit-js="app.js" source-edit-unit="" source-edit-scenario=""></div>
19+
<div source-edit="app" source-edit-deps="angular.js app.js" source-edit-html="index.html-76" source-edit-css="main.css" source-edit-js="app.js" source-edit-unit="" source-edit-scenario=""></div>
2020
<div class="tabbable"><div class="tab-pane" title="index.html">
21-
<pre class="prettyprint linenums" ng-set-text="index.html-77" ng-html-wrap-loaded="app angular.js app.js"></pre>
22-
<script type="text/ng-template" id="index.html-77">
21+
<pre class="prettyprint linenums" ng-set-text="index.html-76" ng-html-wrap-loaded="app angular.js app.js"></pre>
22+
<script type="text/ng-template" id="index.html-76">
2323
<div ng-controller="MainCtrl">
2424
<div ui-grid="gridOptions" class="grid"></div>
2525
</div>
@@ -90,5 +90,5 @@ <h1><code ng:non-bindable=""></code>
9090
</script>
9191
</div>
9292
</div><h4>Demo</h4>
93-
<div class="well doc-example-live animator-container" ng-embed-app="app" ng-set-html="index.html-77" ng-eval-javascript="app.js"></div></div>
93+
<div class="well doc-example-live animator-container" ng-embed-app="app" ng-set-html="index.html-76" ng-eval-javascript="app.js"></div></div>
9494
</div>

docs/partials/tutorial/306_expandable_grid.html

+4-4
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,10 @@ <h1><code ng:non-bindable=""></code>
2929

3030
<p>SubGrid nesting can be done upto multiple levels.</p><h2 id="Example">Example</h2>
3131
<div class="example"><h4>Source</h4>
32-
<div source-edit="app" source-edit-deps="angular.js app.js" source-edit-html="index.html-78 expandableRowTemplate.html" source-edit-css="main.css" source-edit-js="app.js" source-edit-unit="" source-edit-scenario=""></div>
32+
<div source-edit="app" source-edit-deps="angular.js app.js" source-edit-html="index.html-77 expandableRowTemplate.html" source-edit-css="main.css" source-edit-js="app.js" source-edit-unit="" source-edit-scenario=""></div>
3333
<div class="tabbable"><div class="tab-pane" title="index.html">
34-
<pre class="prettyprint linenums" ng-set-text="index.html-78" ng-html-wrap-loaded="app angular.js app.js"></pre>
35-
<script type="text/ng-template" id="index.html-78">
34+
<pre class="prettyprint linenums" ng-set-text="index.html-77" ng-html-wrap-loaded="app angular.js app.js"></pre>
35+
<script type="text/ng-template" id="index.html-77">
3636
<div ng-controller="MainCtrl">
3737
<div class="control-group">
3838
<input type="button" class="btn btn-small" ng-click="expandAllRows()" value="Expand All"/>
@@ -175,5 +175,5 @@ <h1><code ng:non-bindable=""></code>
175175
</script>
176176
</div>
177177
</div><h4>Demo</h4>
178-
<div class="well doc-example-live animator-container" ng-embed-app="app" ng-set-html="index.html-78" ng-eval-javascript="app.js"></div></div>
178+
<div class="well doc-example-live animator-container" ng-embed-app="app" ng-set-html="index.html-77" ng-eval-javascript="app.js"></div></div>
179179
</div>

docs/partials/tutorial/307_external_sorting.html

+6-6
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,10 @@ <h1><code ng:non-bindable=""></code>
1818
column however, so sorting by it has no effect. </p>
1919

2020
<h4>Source</h4>
21-
<div source-edit="app" source-edit-deps="angular.js app.js" source-edit-html="index.html-79" source-edit-css="main.css" source-edit-js="app.js" source-edit-unit="" source-edit-scenario="scenario.js-80"></div>
21+
<div source-edit="app" source-edit-deps="angular.js app.js" source-edit-html="index.html-78" source-edit-css="main.css" source-edit-js="app.js" source-edit-unit="" source-edit-scenario="scenario.js-79"></div>
2222
<div class="tabbable"><div class="tab-pane" title="index.html">
23-
<pre class="prettyprint linenums" ng-set-text="index.html-79" ng-html-wrap-loaded="app angular.js app.js"></pre>
24-
<script type="text/ng-template" id="index.html-79">
23+
<pre class="prettyprint linenums" ng-set-text="index.html-78" ng-html-wrap-loaded="app angular.js app.js"></pre>
24+
<script type="text/ng-template" id="index.html-78">
2525
<div ng-controller="MainCtrl">
2626
<div id="grid1" ui-grid="gridOptions" class="grid"></div>
2727
</div>
@@ -97,8 +97,8 @@ <h4>Source</h4>
9797
</script>
9898
</div>
9999
<div class="tab-pane" title="End to end test">
100-
<pre class="prettyprint linenums" ng-set-text="scenario.js-80"></pre>
101-
<script type="text/ng-template" id="scenario.js-80">
100+
<pre class="prettyprint linenums" ng-set-text="scenario.js-79"></pre>
101+
<script type="text/ng-template" id="scenario.js-79">
102102
var gridTestUtils = require('../../test/e2e/gridTestUtils.spec.js');
103103

104104
describe('307 tutorial', function() {
@@ -153,5 +153,5 @@ <h4>Source</h4>
153153
</script>
154154
</div>
155155
</div><h4>Demo</h4>
156-
<div class="well doc-example-live animator-container" ng-embed-app="app" ng-set-html="index.html-79" ng-eval-javascript="app.js"></div></div>
156+
<div class="well doc-example-live animator-container" ng-embed-app="app" ng-set-html="index.html-78" ng-eval-javascript="app.js"></div></div>
157157
</div>

0 commit comments

Comments
 (0)