Hi Steven,
thanks for your reply, meanwhile i have a solution. The poroblem was the
asynchronous request to fill the table. It runs after my method to add the new
(empty) row and had overidden it. I used setData() instead of addRows() for the
fill-Method. No i am adding the empty row directly within the Eventhandler
filling my table and i also tested a variant which ran the request
synchronously, both worked fine.
Thanks for your support (and of course to all others who'd replied to my
request)
Kind regards,
--
Andreas Tepper
Softwareentwicklung
Animationsfabrik GmbH
Donnerstrasse 20
D-22763 Hamburg
Tel: +49 40 398415-10
Fax: +49 40 398415-32
E-Mail: [EMAIL PROTECTED]
Web: www.animationsfabrik.de
Amtsgericht Hamburg
HRB 75488
Geschäftsführer: Jörn Radel
Sitz der Gesellschaft: Hamburg
-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Steven M. Cherry
Sent: Friday, December 14, 2007 10:26 PM
To: qooxdoo Development
Subject: Re: [qooxdoo-devel] Add New Row
Hi Andreas,
Here's how I add rows to my tables, when the user needs to:
globalEnvAddNew : function(ev) {
var tm = this.globalenv_table.getTableModel();
var envData = tm.getData();
// Display a pop-up with the detailed log information:
var windowTitle = "New Environment Variable:";
// Pop-up the dialog:
var d = qx.ui.core.ClientDocument.getInstance();
var tmpWindow = new my.EditEnvironmentVariable(windowTitle);
d.add(tmpWindow);
tmpWindow.addOkEventListener("execute",
function(e){
envData.push([0,
tmpWindow.envNameField.getValue(),
tmpWindow.envValueField.getValue()
]);
tm.setData(envData);
}, this);
tmpWindow.open();
},
As you can see, at the beginning of the function, I get the entire
original data array, then if the user presses "OK" in the pop-up dialog
I add the new array, and then re-set the table model's data.
Hope that helps,
Steven
On Fri, 2007-12-14 at 11:36 +0100, Andreas Tepper wrote:
> Hi Tobias,
>
> no, not except the version with "this.tableExpenes..." as i wrote. The row
> wouldn't be added simply, that's why i am confused. If i got an error i'll
> maybe got a starting point to get the clou.
>
> Regards,
> --
> Andreas Tepper
> Softwareentwicklung
>
> Animationsfabrik GmbH
> Donnerstrasse 20
> D-22763 Hamburg
>
> Tel: +49 40 398415-10
> Fax: +49 40 398415-32
> E-Mail: [EMAIL PROTECTED]
> Web: www.animationsfabrik.de
>
> Amtsgericht Hamburg
> HRB 75488
> Geschäftsführer: Jörn Radel
> Sitz der Gesellschaft: Hamburg
> -----Original Message-----
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Tobias Koller
> (GERMO GmbH)
> Sent: Friday, December 14, 2007 11:21 AM
> To: qooxdoo Development
> Subject: Re: [qooxdoo-devel] Add New Row
>
> Hi andreas,
>
> Do you get any error-messages ?
>
> Tobias
>
>
>
>
> -----Ursprüngliche Nachricht-----
> Von: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Im Auftrag von Andreas Tepper
> Gesendet: Freitag, 14. Dezember 2007 10:24
> An: qooxdoo Development
> Betreff: Re: [qooxdoo-devel] Add New Row
>
> Hello Tobias,
>
> thanks for your reply. I've tried the addRows-Function before, but it did not
> work. It's a silly phenomenom, this code did not work (adds no empty row at
> the end of my table):
>
> ********************************************************************************************
> (main-Function)
>
> var tableModel = new qx.ui.table.model.Simple();
>
> with (tableModel) {
> setColumns([ "Ausgaben-Id",
> ...
> "Rechnung" ]);
>
> setColumnEditable(8, true);
> ...
> };
>
> var tableExpenses = new qx.ui.table.Table(tableModel);
>
> with (tableExpenses) {
> set({ border:"inset-thin" });
>
>
> getSelectionModel().setSelectionMode(qx.ui.table.selection.Model.SINGLE_SELECTION);
>
> getTableColumnModel().setColumnVisible(0,
> false);
> ...
>
> setColumnWidth(0, 0);
> ...
> setColumnWidth(9, 150);
> ...
>
> setWidth(1430);
> };
>
> I'VE SHORTENED THE TABLMODEL AND TABLE DEFINITIONS A
> BIT, REAL SOURCE CONTAINS WHOLE
> CODE FOR ALL 21 COLUMNS
>
> this.fillExpensesTable(pid, tcid, tableModel);
>
> var emptyRow = new
> Array("","","","","","","","","","","","","","","","","","","","","");
> var wrapper = new Array(emptyRow);
> tableExpenses.getTableModel().addRows(wrapper);
>
> (end of main function)
>
> fillExpensesTable : function(pid, tcid, tableModel) {
>
> try
> {
> //tableModel.removeRows(0, tableModel.getRowCount());
>
> var req = new
> qx.io.remote.Request("http://devserver/projectdetail/costs_report/source/costs_report_backend.php","GET","text/plain");
> req.setParameter("p_id", pid);
> req.setParameter("tc_id", tcid);
> req.setParameter("action", "GetExpensesList");
> req.setTimeout(10000);
> req.addEventListener("completed", function(e){
> try
> {
> var content = e.getContent();
>
> if (content.length > 0)
> {
> var tabledata =
> qx.io.Json.parse(content);
> tableModel.setData(tabledata);
> }
> }
> catch (ex)
> {
> alert("Fehler bei Erhalt der
> Tabellendaten: " + ex.toString());
> }
> });
>
> req.send();
> }
> catch(ex)
> {
> alert("Fehler bei Anforderung der Tabelle: " +
> ex.toString());
> }
> },
> ********************************************************************************************
>
> while this works:
>
> ********************************************************************************************
> (main-Function)
>
> SAME AS ABOVE UNTIL HERE
>
> this.fillExpensesTable(pid, tcid, tableModel);
>
> (end of main function)
>
> fillExpensesTable : function(pid, tcid, tableModel) {
>
> try
> {
> //tableModel.removeRows(0, tableModel.getRowCount());
>
> var req = new
> qx.io.remote.Request("http://devserver/projectdetail/costs_report/source/costs_report_backend.php","GET","text/plain");
> req.setParameter("p_id", pid);
> req.setParameter("tc_id", tcid);
> req.setParameter("action", "GetExpensesList");
> req.setTimeout(10000);
> req.addEventListener("completed", function(e){
> try
> {
> var content = e.getContent();
>
> if (content.length > 0)
> {
> var tabledata =
> qx.io.Json.parse(content);
> tableModel.setData(tabledata);
>
> var emptyRow = new
> Array("","","","","","","","","","","","","","","","","","","","","");
> var wrapper = new
> Array(emptyRow);
> tableModel.addRows(wrapper);
> }
> }
> catch (ex)
> {
> alert("Fehler bei Erhalt der
> Tabellendaten: " + ex.toString());
> }
> });
>
> req.send();
> }
> catch(ex)
> {
> alert("Fehler bei Anforderung der Tabelle: " +
> ex.toString());
> }
> },
> ********************************************************************************************
>
> So if i add the empty row within the fillExpensesTable-Function which
> populates the result from my backend script (database) the row was added
> correctly. If i try to add the row afterwards in the main, the row was not
> added, no matter if i use the tableModel-variable or
> "tableExpenses.getTableModel()".
>
> When i type "this.tableExpenses.getTableModel()" i've got an error saying
> that tableExpenses has no properties...
>
> I am a bit confused, why does the first one not work?
>
> BTW: Thanks for the 29, i wish it would be real... ;-)
>
> Thanks again and kind regards,
> --
> Andreas Tepper
> Softwareentwicklung
>
> Animationsfabrik GmbH
> Donnerstrasse 20
> D-22763 Hamburg
>
> Tel: +49 40 398415-10
> Fax: +49 40 398415-32
> E-Mail: [EMAIL PROTECTED]
> Web: www.animationsfabrik.de
>
> Amtsgericht Hamburg
> HRB 75488
> Geschäftsführer: Jörn Radel
> Sitz der Gesellschaft: Hamburg
> -----Original Message-----
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Tobias Koller
> (GERMO GmbH)
> Sent: Friday, December 14, 2007 7:26 AM
> To: qooxdoo Development
> Subject: Re: [qooxdoo-devel] Add New Row
>
> Hi andreas,
>
> Here is an example:
>
> if you have the following columns: id|name|firstname|age|hobby
>
>
> var row = new Array("1","Tepper", "Andreas", "29", "programmingQooxdoo");
>
> mytable.getTableModel().addRow(row);
>
>
> if you don't want to fill this fields you can also just make something like:
> var row = new Array("","", "", "", "");
>
>
> I didn't try it out but that should work.
>
> Tobias
>
>
> -----Ursprüngliche Nachricht-----
> Von: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Im Auftrag von Andreas Tepper
> Gesendet: Donnerstag, 13. Dezember 2007 14:04
> An: [email protected]
> Betreff: [qooxdoo-devel] Add New Row
>
> Hi,
>
> i have a table (qx.ui.table.Table(tableModel) where tableModel is
> qx.ui.table.model.Simple()) which is partly editable by the user. Also users
> should be able to add new rows to the table. In other GUI-Environments, like
> the DataGridView from MS .Net-Framework Forms, you have a special "last row"
> which is empty to add a row to the table (nomrally marked with * in the
> row-header, i think you all know what i mean).
>
> How could i achieve this with qooxdoo-Tables? Another question is, if it is
> possible to provide such a "add new row row", how to set up default values,
> e.g. for columns the user must not or do not want to edit?
>
> It would be highly appriciated if somebody has a piece of sample-code
> regarding these matters.
>
> Thanks for your help & kind regards,
> --
> Andreas Tepper
> Softwareentwicklung
>
> Animationsfabrik GmbH
> Donnerstrasse 20
> D-22763 Hamburg
>
> Tel: +49 40 398415-10
> Fax: +49 40 398415-32
> E-Mail: [EMAIL PROTECTED]
> Web: www.animationsfabrik.de
>
> Amtsgericht Hamburg
> HRB 75488
> Geschäftsführer: Jörn Radel
> Sitz der Gesellschaft: Hamburg
>
> -------------------------------------------------------------------------
> SF.Net email is sponsored by:
> Check out the new SourceForge.net Marketplace.
> It's the best place to buy or sell services
> for just about anything Open Source.
> http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace
> _______________________________________________
> qooxdoo-devel mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel
>
> -------------------------------------------------------------------------
> SF.Net email is sponsored by:
> Check out the new SourceForge.net Marketplace.
> It's the best place to buy or sell services
> for just about anything Open Source.
> http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace
> _______________________________________________
> qooxdoo-devel mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel
>
> -------------------------------------------------------------------------
> SF.Net email is sponsored by:
> Check out the new SourceForge.net Marketplace.
> It's the best place to buy or sell services
> for just about anything Open Source.
> http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace
> _______________________________________________
> qooxdoo-devel mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel
>
> -------------------------------------------------------------------------
> SF.Net email is sponsored by:
> Check out the new SourceForge.net Marketplace.
> It's the best place to buy or sell services
> for just about anything Open Source.
> http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace
> _______________________________________________
> qooxdoo-devel mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel
>
> -------------------------------------------------------------------------
> SF.Net email is sponsored by:
> Check out the new SourceForge.net Marketplace.
> It's the best place to buy or sell services
> for just about anything Open Source.
> http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace
> _______________________________________________
> qooxdoo-devel mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel
-------------------------------------------------------------------------
SF.Net email is sponsored by:
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services
for just about anything Open Source.
http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace
_______________________________________________
qooxdoo-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel
-------------------------------------------------------------------------
SF.Net email is sponsored by:
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services
for just about anything Open Source.
http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace
_______________________________________________
qooxdoo-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel