Skip to content

Commit e5f4787

Browse files
committed
Doc - View One: more on validation and layout.
1 parent 5467ff7 commit e5f4787

File tree

1 file changed

+54
-16
lines changed

1 file changed

+54
-16
lines changed

doc/views.html

Lines changed: 54 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,7 @@ <h1>Views</h1>
8585
<a href="#one-mini"><i class="glyphicon glyphicon-th-large"></i>Mini (quick-edit)</a>
8686
<a href="#one-json"><i class="glyphicon glyphicon-barcode"></i>JSON</a>
8787
</li>
88+
<p><a href="#validation">Validation</a><a href="#layout">Layout</a></p>
8889

8990
<li>Views for a collection of <strong>many</strong> models: <a href="#many">Evol.ViewMany</a>
9091
<br/>
@@ -104,7 +105,6 @@ <h1>Views</h1>
104105

105106
</p>
106107

107-
<p>Views <a href="#validation">Validation</a> and <a href="#layout">Layout</a>.</p>
108108

109109
<div class="v-sep"></div>
110110

@@ -115,19 +115,24 @@ <h1>Views</h1>
115115

116116
<h2>Evol.ViewOne</h2>
117117

118-
<p>Views for <strong>one</strong> model:
118+
<p>Evol.ViewOne provide a set of Backbone Views for to browse, add and edit <strong>one</strong> model.</p>
119+
120+
<p>Views:
119121

120122
<span class="evo-links-views">
121123
<a href="#one-browse"><i class="glyphicon glyphicon-eye-open"></i>Browse</a>,
122124
<a href="#one-edit"><i class="glyphicon glyphicon-edit"></i>Edit</a>,
123125
<a href="#one-mini"><i class="glyphicon glyphicon-th-large"></i>Mini</a> (quick-edit),
124126
<a href="#one-json"><i class="glyphicon glyphicon-barcode"></i>JSON</a>.
125127
</span>
126-
</p>
128+
</p>
127129

128130
<p>API: <a href="#one-api-options">Options</a> - <a href="#one-api-methods">Methods</a> - <a href="#one-api-events">Events</a>
129131
</p>
130132

133+
<p>More: <a href="#one-api-options">Validation</a> - <a href="#one-api-methods">Layout</a>
134+
</p>
135+
131136
<a name="one-browse" class="evo-anchor">&nbsp;</a>
132137
<div id="doc-browse">
133138
<h3><i class="glyphicon glyphicon-eye-open"></i>&nbsp;Browse <span class="view-fullname">Evol.ViewOne.Browse</span></h3>
@@ -208,20 +213,10 @@ <h3><i class="glyphicon glyphicon-barcode"></i>&nbsp;JSON <span class="view-full
208213
<p><br>API: <a href="#one-api-options">Options</a> - <a href="#one-api-methods">Methods</a> - <a href="#one-api-events">Events</a></p>
209214

210215

211-
</div>
212-
213-
214-
<div id="vw-one"></div>
215-
216-
</section>
217-
218-
219-
220-
221216
<a name="validation" class="evo-anchor">&nbsp;</a>
222217
<section>
223218
<h2>Validation</h2>
224-
<p>Validation is determined by the field properties. Validation happens when the user click the "Save" button.</p>
219+
<p>Validation is determined by the field properties.</p>
225220

226221
<ul>
227222
<li><span class="xmlAttr">type</span> - Text, Integer, Decimal, Date...</li>
@@ -231,9 +226,11 @@ <h2>Validation</h2>
231226
<li><span class="xmlAttr">maxLength</span> - Maximum length.</li>
232227
<li><span class="xmlAttr">minLength</span> - Minimum length.</li>
233228
<li><span class="xmlAttr">regExp</span> - Regular expression to verify.</li>
234-
<li><span class="xmlAttr">fnValidate</span> - Custom validation function that the model must pass.</li>
229+
<li><span class="xmlAttr">fnValidate</span> - Custom validation function.</li>
235230
</ul>
236231

232+
<p>Validation happens when the user click the "Save" button. Invalid fields are flagged and a summary is displayed.</p>
233+
237234
</section>
238235

239236

@@ -254,8 +251,25 @@ <h2>Layout</h2>
254251
<p>In the following screenshot the form is organized into 4 panels for "Identity"
255252
(width=60%), "Contact Info" (width=40%), "Address" (width=60%), and
256253
"Misc." (width=40%). Each of these panels contains one or several fields.</p>
254+
255+
<TABLE cellSpacing="0" cellPadding="0" border="0" >
256+
<TR>
257+
<TD vAlign="top">
257258
<p><img src="screenshots/position-panels.gif" class="pixEvoPos shadow">
258259
</p>
260+
261+
</TD>
262+
<td>&nbsp;&nbsp;</td>
263+
<TD vAlign="top"><br>
264+
<P>Identity: width=60%<br/>
265+
"Contact Info": width=40%<br/>
266+
Address: width=60%<br/>
267+
"Misc.": width=40%</p>
268+
</TD>
269+
</TR>
270+
</TABLE>
271+
272+
259273
<p>Inside each panel, fields are placed using the same rule: placed sequentially,
260274
left to right, until a width of 100% is reached.</p>
261275

@@ -309,14 +323,38 @@ <h2>Layout</h2>
309323
</TR>
310324
</TABLE>
311325

312-
<h3>View layout customization with CSS</h3>
326+
<h4>View layout customization with CSS</h4>
313327

314328
<p>It is possible to enhance or adapt layout by adding CSS classes. </p>
329+
<p>For example, here is a CSS to change the background of all cards in the Cards views for all apps.
330+
<pre><code>.evol-cards-body > .panel {
331+
background-color: blue;
332+
}
333+
</code></pre>
334+
</p>
335+
<p>It can also by applied to a specific object as follow:
336+
337+
<pre><code>[data-eid="contact"] .evol-cards-body > .panel {
338+
background-color: green !important;
339+
}
340+
</code></pre>
341+
</p>
342+
315343
<p>For the demo, in Cards view, cards height is defined in CSS for each entity.</p>
316344

317345
</section>
318346

319347

348+
349+
</div>
350+
351+
352+
<div id="vw-one"></div>
353+
354+
</section>
355+
356+
357+
320358
<a name="many" class="evo-anchor">&nbsp;</a>
321359
<section id="views-many">
322360

0 commit comments

Comments
 (0)