Permalink
Browse files

- Added support for textarea and HTMLarea fields + i18n additional la…

…bels

  (editor Save/Cancel,  YUI Datatable Loading/Error messages, and also column sort tooltips (new in YUI 29.0).
- Added CSS files for the existing two DataTable Templates.  Each file should be added to the corresponding
  template as a CSS Attachment.
- Avoid terminating the editor on Enter.
- Arrange for TAB to save and move editor for next cell also for HTMLarea editor.
- Define classes "wg-dt-textarea" and "wg-dt-htmlarea" + styling for the corresponding cells.
- Commented out handleTableKeyEvent() (reason in the code).
- Implemented a simple workaround to restore the "editor" field (not preserved due to an unknown reason).
  • Loading branch information...
1 parent 1fd29bf commit 5aa0835649900a4f2dfdb1dd048bc19785e4db64 @ampli committed Jul 12, 2011
@@ -74,6 +74,18 @@ our $I18N = {
context => q{Format for a column with a date},
},
+ "format textarea" => {
+ message => q{Textarea},
+ lastUpdated => 0,
+ context => q{Format for a textarea column},
+ },
+
+ "format htmlarea" => {
+ message => q{HTMLarea},
+ lastUpdated => 0,
+ context => q{Format for an HTMLarea column},
+ },
+
"add column" => {
message => q{Add Column},
lastUpdated => 0,
@@ -152,6 +164,23 @@ our $I18N = {
context => q{The name of a newly added value to a column},
},
+ "data error" => {
+ message => q{Data error.},
+ lastUpdated => 0,
+ context => q{Message to display when DataTable has data error},
+ },
+
+ "sort ascending" => {
+ message => q{Click to sort ascending},
+ lastUpdated => 0,
+ context => q{Message to display in tooltip to sort Column in ascending order},
+ },
+
+ "sort descending" => {
+ message => q{Click to sort descending},
+ lastUpdated => 0,
+ context => q{Message to display in tooltip to sort Column in descending order},
+ },
};
1;
@@ -0,0 +1,60 @@
+/**
+ * wg-datatable-html.css
+ * CSS rules for DataTable assets
+ *
+ * Add as attachment to Default DetaTable template (HTML)
+ */
+
+
+/* start content at top of cells */
+.dataTable table>tbody>tr>td {
+ vertical-align: 0;
+}
+.dataTable>table>tbody>tr>td>p:first-child { /* for htmlarea, but really applies to the starting p of any cell */
+ margin-top: 0;
+}
+
+/* padding in all data cells */
+.dataTable table>tbody>tr>td {
+ padding-left: 10px;
+ padding-right: 10px;
+}
+
+
+/* examples of further styles */
+
+/* limited textarea/htmlarea cells, show vertical scrollbar if needed */
+/*
+.dataTable table>tbody>tr>td {
+ height: 70px;
+ width: 200px;
+ overflow-y: auto;
+}
+*/
+
+/* styling a particular DataTable in the page, by assetId */
+/*
+#dataTablesrvp2vk8QJqY5E0imSRQag.dataTable table>tbody>tr>td {
+ color:red;
+ height:auto;
+ width:150px;
+ overflow-y: visible
+}
+*/
+
+/* minimum row height */
+/*
+.dataTable table>tbody>tr>td {
+ min-height:70px;
+ height:auto !important;
+ height:70px;
+}
+*/
+
+/* styling a particular column (e.g column 2), by assetId */
+/*
+#dataTablesvE67R6JQfmEI__T9pIAkQ.dataTable table>tbody>tr>td:first-child+td {
+ color:blue;
+}
+*/
+
@@ -0,0 +1,59 @@
+/**
+ * wg-datatable-yui.css
+ * CSS rules for DataTable assets
+ *
+ * Add as attachment to Default DetaTable template (YUI)
+ */
+
+
+/* start content at top of cells */
+.yui-dt-editable {
+ vertical-align: 0;
+}
+.wg-dt-htmlarea>p:first-child {
+ margin-top: 0;
+}
+
+/* padding in all data cells */
+td.yui-dt-editable .yui-dt-liner {
+ padding-left: 10px;
+ padding-right: 10px;
+}
+
+/* examples of further styles */
+
+/* limited textarea/htmlarea cells, show vertical scrollbar if needed */
+/*
+.wg-dt-textarea, .wg-dt-htmlarea {
+ height: 70px;
+ width: 200px;
+ overflow-y: auto;
+}
+*/
+
+
+/* styling a particular DataTable in the page */
+/*
+#dataTablesrvp2vk8QJqY5E0imSRQag .wg-dt-textarea, #dataTablesrvp2vk8QJqY5E0imSRQag .wg-dt-htmlarea {
+ color:red;
+ height:auto;
+ width:150px;
+ overflow:visible;
+}
+*/
+
+/* minimum row height */
+/*
+td.yui-dt-editable .yui-dt-liner {
+ min-height:70px;
+ height:auto !important;
+ height:70px;
+}
+*/
+
+/* styling a particular column */
+/*
+#dataTablesrvp2vk8QJqY5E0imSRQag .yui-dt-col-col1 .yui-dt-liner {
+ color:blue;
+}
+*/
@@ -7,3 +7,15 @@
.yui-dt-editable .yui-dt-liner {
min-height: 10px;
}
+
+/* displaying the initial blank line in HTMLarea is not useful */
+.wg-dt-htmlarea>p:first-child {
+ margin-top: 0;
+}
+
+/* size of Textarea/HTMLarea cell */
+.wg-dt-textarea, .wg-dt-htmlarea {
+ height: 50px;
+ width: 150px;
+ overflow-y: auto;
+}
Oops, something went wrong.

0 comments on commit 5aa0835

Please sign in to comment.