Hello,see attached a Patch for adding a new Property to Table.js. It's to append a additionalStatusText to the default Statusline of a Table, since we need to show not only the number of Rows. Hopefully the others needs such a functionality too.
You will also find a qx.ui.table.cellrenderer.Html.js it is used to display HTML-Content as a Value of a Cell witch is not escaped.
In Table_4.patch you will find a Patch for application/demobrowser/source/html/example/Table_4.html witch will add/test the new features.
Regards Dirk
Index: framework/source/class/qx/ui/table/Table.js
===================================================================
--- framework/source/class/qx/ui/table/Table.js (Revision 12040)
+++ framework/source/class/qx/ui/table/Table.js (Arbeitskopie)
@@ -332,6 +332,14 @@
init : true,
apply : "_applyStatusBarVisible"
},
+
+ /** The Statusbartext, set it, if you want some more Information */
+ additionalStatusBarText :
+ {
+ nullable : true,
+ init : null,
+ apply : "_applyAdditionalStatusBarText"
+ },
/** Whether to show the column visibility button */
columnVisibilityButtonVisible :
@@ -653,6 +661,21 @@
this._updateStatusBar();
}
},
+
+ // property modifier
+ /**
+ * @type member
+ * @param value {var} Current value
+ * @param old {var} Previous value
+ */
+ _applyAdditionalStatusBarText : function(value, old)
+ {
+ this._additionalStatusBarText = value;
+
+ if(value) {
+ this._updateStatusBar();
+ }
+ },
// property modifier
/**
@@ -1526,13 +1549,25 @@
var text;
- if (selectedRowCount == 0) {
- text = this.trn("one row", "%1 rows", rowCount, rowCount);
- } else {
- text = this.trn("one of one row", "%1 of %2 rows", rowCount, selectedRowCount, rowCount);
- }
+ if(rowCount > 0) {
+ if (selectedRowCount == 0) {
+ text = this.trn("one row", "%1 rows", rowCount, rowCount);
+ } else {
+ text = this.trn("one of one row", "%1 of %2 rows", rowCount, selectedRowCount, rowCount);
+ }
+ }
+
+ if(this._additionalStatusBarText) {
+ if(text) {
+ text += this._additionalStatusBarText;
+ } else {
+ text = this._additionalStatusBarText;
+ }
+ }
- this._statusBar.setText(text);
+ if(text) {
+ this._statusBar.setText(text);
+ }
}
},
Html.js
Description: application/javascript
Index: application/demobrowser/source/html/example/Table_4.html
===================================================================
--- application/demobrowser/source/html/example/Table_4.html (Revision 12040)
+++ application/demobrowser/source/html/example/Table_4.html (Arbeitskopie)
@@ -29,15 +29,16 @@
// table model
var tableModel = new qx.ui.table.model.Filtered();
- tableModel.setColumns([ "ID", "A number", "A date", "Boolean test" ]);
+ tableModel.setColumns([ "ID", "A number", "A date", "Boolean test", "HTML Content" ]);
var rowData = [];
var now = new Date().getTime();
var dateRange = 400 * 24 * 60 * 60 * 1000; // 400 days
-
for (var row=0; row<20; row++)
{
var date = new Date(now + Math.random() * dateRange - dateRange / 2);
- rowData.push([ row, Math.random() * 10000, date, (Math.random() > 0.5) ]);
+ var html = "<b>HTML-Test</b>";
+
+ rowData.push([ row, Math.random() * 10000, date, (Math.random() > 0.5), html ]);
}
tableModel.setData(rowData);
@@ -50,49 +51,56 @@
table.setMetaColumnCounts([ 1, -1 ]);
table.getSelectionModel().setSelectionMode(qx.ui.table.selection.Model.MULTIPLE_INTERVAL_SELECTION);
table.getTableColumnModel().setDataCellRenderer(3, new qx.ui.table.cellrenderer.Boolean());
+ table.getTableColumnModel().setDataCellRenderer(4, new qx.ui.table.cellrenderer.Html());
table.addToDocument();
+
+ table.setAdditionalStatusBarText(", additional Status.");
var button1 = new qx.ui.form.Button("Hide True");
button1.setTop(400);
- button1.setLeft(450);
+ button1.setLeft(550);
button1.addToDocument();
button1.addEventListener("execute",
function(e)
{
tableModel.addNumericFilter("==", 1, "Boolean test");
tableModel.applyFilters();
+ table.setAdditionalStatusBarText(", additional Status. True Values are hidden.");
});
var button2 = new qx.ui.form.Button("Hide False");
button2.setTop(400);
- button2.setLeft(550);
+ button2.setLeft(650);
button2.addToDocument();
button2.addEventListener("execute",
function(e)
{
tableModel.addNumericFilter("!=", 1, "Boolean test");
tableModel.applyFilters();
+ table.setAdditionalStatusBarText(", additional Status. False Values are hidden.");
});
var button3 = new qx.ui.form.Button("Hide 1k-5k");
button3.setTop(500);
- button3.setLeft(450);
+ button3.setLeft(550);
button3.addToDocument();
button3.addEventListener("execute",
function(e)
{
tableModel.addBetweenFilter("between", 1000, 5000, "A number");
tableModel.applyFilters();
+ table.setAdditionalStatusBarText(", additional Status. 1k - 5k Values are hidden.");
});
var button4 = new qx.ui.form.Button("Show All");
button4.setTop(500);
- button4.setLeft(550);
+ button4.setLeft(650);
button4.addToDocument();
button4.addEventListener("execute",
function(e)
{
tableModel.resetHiddenRows();
+ table.setAdditionalStatusBarText(", additional Status. All Values are shown.");
});
}
}
------------------------------------------------------------------------- This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2008. http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________ qooxdoo-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel
