Skip to content

Commit d0e3e58

Browse files
committed
Use boolean attributes for boolean values.
1 parent 34cf0d2 commit d0e3e58

File tree

3 files changed

+61
-30
lines changed

3 files changed

+61
-30
lines changed

dist/aha-table.html

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -191,6 +191,7 @@
191191
class="rows
192192
{{ row._modified ? 'modified' : '' }}
193193
{{ row._editing ? 'editing' : '' }}
194+
{{ row._selected ? 'selected' : '' }}
194195
">
195196
<td>
196197
<input type="checkbox"
@@ -328,13 +329,13 @@
328329
//all visiable rows are reference here.
329330
viewingRow: [],
330331
//selectable: if table row is selectable
331-
selectable: true,
332+
selectable: false,
332333
//copyable: if table row is copyable
333-
copyable: true,
334+
copyable: false,
334335
//removable: if table row is removable
335-
removable: true,
336+
removable: false,
336337
//searchable: if table row is searchable
337-
searchable: true,
338+
searchable: false,
338339
// text displayed in first column of search row.
339340
searchtitle: "",
340341
// text displayed as title of select checkbox.
@@ -427,6 +428,7 @@
427428
}
428429
this.refreshPagination();
429430
},
431+
modifiedChanged: function() {},
430432
//translate value to labels for select
431433
translate: function(value, options, blank){
432434
if (value != "" && options) {
@@ -439,7 +441,6 @@
439441
value = value === undefined || value === null ? '' : value;
440442
return value === "" ? blank : value;
441443
},
442-
modifiedChanged: function() {},
443444
capitalize: function(value) {
444445
if (!value instanceof String || value.length === 0)
445446
return value;
@@ -754,9 +755,9 @@
754755
name: "",
755756
//column type: string, text, date, time, datetime, choice
756757
type: "string",
757-
sortable: true,
758-
searchable: true,
759-
editable: true,
758+
sortable: false,
759+
searchable: false,
760+
editable: false,
760761
requried: false,
761762
//used for placeholder for empty cell.
762763
placeholder: undefined,

index.html

Lines changed: 43 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
padding: 8px 5px;
3030
border: 1px solid #a0cfef;
3131
}
32-
#themed tbody tr.rows:hover, .selected {
32+
#themed tbody tr.rows:hover, #themed .rows.selected {
3333
background-color: #f3f3f3;
3434
color: #1B8CCD;
3535
}
@@ -81,16 +81,21 @@ <h2>Simplest usage: raw style, auto-detected columns, default attributes</h2>
8181
<h2>Advanced usage: themed, customized columns, customized attributes, customized event handlers.</h2>
8282
<div id="console"></div>
8383
<aha-table id="themed"
84-
selectable="true"
85-
copyable="true"
86-
searchable="false"
84+
85+
selectable
86+
searchable
87+
copyable
88+
removable
89+
8790
pagesize="5"
8891
data-sizelist="[2,5,10]"
92+
8993
pagesizetext="Page Size: "
9094
summarytext="Viewing: "
9195
pagetext="Page:"
9296
pageoftext="of"
9397
itemoftext="of"
98+
9499
searchtitle="Show/Hide Filters"
95100
sorttitle="click to sort"
96101
selecttitle="click to select"
@@ -103,55 +108,79 @@ <h2>Advanced usage: themed, customized columns, customized attributes, customize
103108
previoustitle="Previous"
104109
nexttitle="Next"
105110
lasttitle="Last"
111+
106112
copyclass="fa fa-copy"
107113
hintclass="fa fa-info-circle"
108114
removeclass="fa fa-trash-o"
109115
filtershownclass="fa fa-search-minus"
110116
filterhiddenclass="fa fa-search-plus">
111117
<aha-column name="title"
112118
type="string"
113-
sortable="false"
114-
required="true"
115-
editable="false"
119+
120+
sortable
121+
searchable
122+
editable
123+
required
124+
116125
searchplaceholder="Type to filter title"
117126
placeholder="Evenet Title"
118127
default=""
119128
hint="Meaningful title will help you remember"></aha-column>
120129
<aha-column name="date"
121130
type="date"
122-
searchable="false"
123-
required="true"
131+
132+
searchable
133+
editable
134+
sortable
135+
required
136+
124137
placeholder="Event Date"
125138
hint="Dates are required"
126139
default="2011-12-21"></aha-column>
127140
<aha-column name="time"
128141
type="time"
129-
searchable="false"
142+
editable
143+
130144
placeholder="Event Time"
131145
hint="Time are not required"
132146
default="19:00"></aha-column>
133147
<aha-column name="datetime"
134148
type="datetime"
135-
searchable="false"
149+
editable
150+
136151
placeholder="Stop Date Time"
137152
hint="Time are not required"></aha-column>
138153
<aha-column name="type"
139154
type="choice"
140-
required="true"
155+
156+
searchable
157+
editable
158+
sortable
159+
required
160+
141161
placeholder="Event Type"
142162
default="private"
143163
hint="Public events will be available to everyone"
144164
data-choices='{"":"", "private":"Private Event", "public":"Public Event"}'></aha-column>
145165
<aha-column name="enabled"
146166
type="boolean"
147-
required="true"
167+
168+
searchable
169+
editable
170+
sortable
171+
required
172+
148173
data-choices='{"1":"Yes", "0":"No"}'
149174
placeholder="Yes/No"
150175
hint="Only enabled events will get alert"
151176
default=""></aha-column>
152177
<aha-column name="content"
153178
type="text"
154-
required="true"
179+
180+
searchable
181+
editable
182+
required
183+
155184
hint="Keep it short"
156185
placeholder="Event Content"
157186
default=""></aha-column>

src/aha-table.html

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -191,6 +191,7 @@
191191
class="rows
192192
{{ row._modified ? 'modified' : '' }}
193193
{{ row._editing ? 'editing' : '' }}
194+
{{ row._selected ? 'selected' : '' }}
194195
">
195196
<td>
196197
<input type="checkbox"
@@ -328,13 +329,13 @@
328329
//all visiable rows are reference here.
329330
viewingRow: [],
330331
//selectable: if table row is selectable
331-
selectable: true,
332+
selectable: false,
332333
//copyable: if table row is copyable
333-
copyable: true,
334+
copyable: false,
334335
//removable: if table row is removable
335-
removable: true,
336+
removable: false,
336337
//searchable: if table row is searchable
337-
searchable: true,
338+
searchable: false,
338339
// text displayed in first column of search row.
339340
searchtitle: "",
340341
// text displayed as title of select checkbox.
@@ -427,6 +428,7 @@
427428
}
428429
this.refreshPagination();
429430
},
431+
modifiedChanged: function() {},
430432
//translate value to labels for select
431433
translate: function(value, options, blank){
432434
if (value != "" && options) {
@@ -439,7 +441,6 @@
439441
value = value === undefined || value === null ? '' : value;
440442
return value === "" ? blank : value;
441443
},
442-
modifiedChanged: function() {},
443444
capitalize: function(value) {
444445
if (!value instanceof String || value.length === 0)
445446
return value;
@@ -754,9 +755,9 @@
754755
name: "",
755756
//column type: string, text, date, time, datetime, choice
756757
type: "string",
757-
sortable: true,
758-
searchable: true,
759-
editable: true,
758+
sortable: false,
759+
searchable: false,
760+
editable: false,
760761
requried: false,
761762
//used for placeholder for empty cell.
762763
placeholder: undefined,

0 commit comments

Comments
 (0)