ZK - Open Source Ajax Java FrameworkZK - Open Source Ajax Java Framework

Excel-like editing in Grid and dynamic rows in ZK

mortoza
6 Feb 2012 06:13:01 GMT
6 Feb 2012 06:13:01 GMT

Hi ZK gurus,
I am new to ZK, mostly working in java and wondering if it is possible to use ZK grid (or list) in my interface and edit that like excel the idea is as follows:
a) move cursor by arrow keys (or the mouse), type and edit at any cell I want to.
b) If I am at the last row and exit a certain cell, a new row will be created autmatically
c) a Single save button will save all the lines in the grid

Thanks for inputs with code sample.
Mortoza

henrichen
23 Feb 2012 02:49:44 GMT
23 Feb 2012 02:49:44 GMT

Use <textbox inplace="true"> and maybe you can listen to KeyEvent and change textbox focus accordingly.

javafan
23 Feb 2012 04:40:05 GMT
23 Feb 2012 04:40:05 GMT

Hi
Do you mean something like example here?

How can I use arrow key to move cursor from one cell to other (all 4 directions) while not editing the cell.

regards

henrichen
23 Feb 2012 05:21:16 GMT
23 Feb 2012 05:21:16 GMT

@javafan,

Yes. Something like that. Have to listen to onCtrlKey event to move your focus around.

http://www.zkoss.org/javadoc/latest/zk/org/zkoss/zul/impl/XulElement.html#setCtrlKeys(java.lang.String)

mortoza
23 Feb 2012 05:36:39 GMT
23 Feb 2012 05:36:39 GMT

Hi Henrichen
Do you have a sample code for this? Thanks in advance for sharing!

henrichen
23 Feb 2012 06:04:53 GMT
23 Feb 2012 06:04:53 GMT

@mortoza,

Sorry, I don't have existing sample code to share but I think you can use onCtrlKey and inplace editor to implement what you need.