On Sat, Oct 10, 2009 at 08:15, skar <[email protected]> wrote:
> Hi,
>
> I need to have my users input some new rows(some 3-4 columns) for my
> table and then save them to server. What's the best way to get this done?
>
> I tried having an empty row as the 0th row of the table, focusing on the
> first cell and editing it, but if the user stops entering and presses
> "Esc", I won't know if he meant to have the current editor data to be
> saved or he meant to cancel the new row. Is there anyway I can show a
> popup over the first row with the corresponding text field with a cancel
> button?
>
This is similar to the purpose for which I created the modal window cell
editor concept. If your cell editor factory returns an object that is an
instance of qx.ui.window.Window, it will be automagically made modal and the
function that you've registered with
table.setModalCellEditorPreOpenFunction() will be called with the cell
editor object and cellInfo as parameters. Upon return from that function,
(or immediately if no function has been registered), the window will then be
opened. When the window is closed, typically by th user pressing a Save
button of some sort, the value for the particular cell which was clicked
will be retrieved in the normal fashion, by calling the cell editor
factory's getCellEditorValue() method with the cell editor as its parameter.
You can look at table/pane/Scroller.js, methods startEditing(),
stopEditing(), flushEditor(), and cancelEditing() for additional hints. I
suspect that upon Save, you'll want to add the row to the data model, rather
than expecting the closing of the modal window to save everything, since you
want to add multiple rows.
Alternatively, you could simply have an Add button that adds a new row to
the model, using a modal window in a similar fashion to what the modal cell
editor would do.
Derrell
------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
_______________________________________________
qooxdoo-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel