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