I'll add the semi colons but I don't see how that is going to keep the function from being called the second time I edit the cell. Like I stated, it works fine the first time I edit the cell, when I try and edit the contents a second time (even if I go to another cell in between) the function is not even called. Modifying the function should have no bearing on when it's called.
Thanks, Jim On Fri, Apr 24, 2009 at 1:40 AM, Alexander Back <[email protected]> wrote: > Hi Jim, > > On Friday 24 April 2009 Jim Hunter wrote: >> I had a need for the column data in a table to be only numeric. >> Without giving it much thought I just set the renderer to Numeric but >> when I entered new text in, naturally it allowed me to enter anything. >> So then I added a celleditor.TextField to the column and created a >> simple validation function to test if the data is numeric: >> >> var chkNum = function(value, oldValue){ >> if (isNaN(value)) >> return oldValue >> else return value >> } > That sound reasonable and I've just tested your code with a demo ("Table-Cell- > Editor") of the demobrowser and it worked out for me. All I added are the > semicolons at the end of the "return" statements. > >> The FIRST time you enter data in the cell, the validation works >> perfect. If you enter non-numeric data it gets changed back to the >> original numeric data that was in the cell. But if you do it again >> (and all subsequent entries), it allows the non-numeric data. No >> validation is performed. I put a debug line in the validation function >> and it is only called for the first edit, not on any subsequent edits. >> >> If this is a bug, as I am sure it is, I will enter it into the bug >> system. Just let me know if I am loosing my mind or not. Or is there >> an easier way to restrict data entry to be numeric data? > As far as I can see there is no bug. It worked out for me and this is also the > way to do it. Can you post a small code snippet? Maybe we can track down the > issue easier this way. > > cheers, > Alex > > ------------------------------------------------------------------------------ > Crystal Reports - New Free Runtime and 30 Day Trial > Check out the new simplified licensign option that enables unlimited > royalty-free distribution of the report engine for externally facing > server and web deployment. > http://p.sf.net/sfu/businessobjects > _______________________________________________ > qooxdoo-devel mailing list > [email protected] > https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel > ------------------------------------------------------------------------------ Crystal Reports - New Free Runtime and 30 Day Trial Check out the new simplified licensign option that enables unlimited royalty-free distribution of the report engine for externally facing server and web deployment. http://p.sf.net/sfu/businessobjects _______________________________________________ qooxdoo-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel
