File tree Expand file tree Collapse file tree 2 files changed +16
-0
lines changed Expand file tree Collapse file tree 2 files changed +16
-0
lines changed Original file line number Diff line number Diff line change @@ -39,6 +39,14 @@ row numbers
39
39
width : 40px ;
40
40
}
41
41
42
+ /*
43
+ row names
44
+ */
45
+ .maklesoft-datatable .maklesoft-datatable-rowname {
46
+ text-align : right;
47
+ padding : 5px ;
48
+ }
49
+
42
50
/*
43
51
column names
44
52
*/
Original file line number Diff line number Diff line change @@ -60,6 +60,9 @@ http://www.maklesoft.com
60
60
if (typeof(data) == "number")
61
61
return "number";
62
62
}
63
+
64
+ 03/17/2013 - Diego Torres - Handling row names instead of row numbers.
65
+
63
66
*/
64
67
enyo . kind ( {
65
68
name : "maklesoft.DataTable" ,
@@ -74,6 +77,7 @@ enyo.kind({
74
77
showRowNumbers : false ,
75
78
showColumnNames : false ,
76
79
columnNames : "ABCDEFGHIJKLMNOPQURSTUVWXYZ" . split ( "" ) ,
80
+ rowNames : [ ] ,
77
81
cellClass : function ( rowIndex , colIndex , data ) {
78
82
var className = "maklesoft-datatable-cell" ;
79
83
if ( rowIndex % 2 == 1 ) {
@@ -133,7 +137,11 @@ enyo.kind({
133
137
if ( this . showRowNumbers && this . showColumnNames && row === 0 && col === 0 ) {
134
138
return ;
135
139
} else if ( this . showRowNumbers && col === 0 ) {
140
+ if ( this . rowNames . length > 0 ) {
141
+ return { content : this . showColumnNames ? this . rowNames [ row - 1 ] : this . rowNames [ row ] , className : "maklesoft-datatable-rowname" } ;
142
+ } else {
136
143
return { content : this . showColumnNames ? row - 1 : row , className : "maklesoft-datatable-rownumber" } ;
144
+ }
137
145
} else if ( this . showColumnNames && row === 0 ) {
138
146
return { content : this . showRowNumbers ? this . columnNames [ col - 1 ] : this . columnNames [ col ] , className : "maklesoft-datatable-colname" } ;
139
147
} else {
You can’t perform that action at this time.
0 commit comments