Confused about the purpose of validation event handlers on grid cells
Hi Alex,
I have to say that I'm really, really impressed with the product.
I am mid-level (3+ yrs experience) PHP and JS programmer, and pretty much a complete newbie to AJAX programming. It's great to start with a well-designed toolkit like yours.
Right now, however, I am a bit puzzled by a problem that I'm having. Let me explain.
I am using the grid control to let our users edit a very short DB table on our server. I very much like the idea of having a change to an editable cell be committed to the server as soon as you blur from the cell.
All that works fine and dandy, until I try to implement my error handling... what happens if something goes wrong on the server side?
I have managed to have the server generate a well-formed XML doc that I parse using the DOM, and I can pop up alerts with detailed status on the error. However...
The newly typed text stays on the cell!!! I don't want this, the change didn't make it into the DB. I want the old text back in there. I had high hopes that event handlers such as onCellValidating or onCellValidated would PREVENT the typed text from being shown if one returned false from their assigned functions. However, this is completely ineffectual. If one returns false from either of these handlers, onCellEditEnding and obj.onCellEditEnded proceed in sequence as if nothing had happened.
Is there a way to tell the grid
"look, NO! This entry doesn't validate! ABORT!" ??
That's what the event handler's name suggests it would do.
More to the point, is there a way to just revert to the old text if the newly-typed one didn't make it into the server? How would you go about this.
And (sorry) one further question: if those event handlers don't do what I think they do, could you briefly exlpain their purpose?
Thanks, and congratulations again on an outstanding product.
QUASAR
I have to say that I'm really, really impressed with the product.
I am mid-level (3+ yrs experience) PHP and JS programmer, and pretty much a complete newbie to AJAX programming. It's great to start with a well-designed toolkit like yours.
Right now, however, I am a bit puzzled by a problem that I'm having. Let me explain.
I am using the grid control to let our users edit a very short DB table on our server. I very much like the idea of having a change to an editable cell be committed to the server as soon as you blur from the cell.
All that works fine and dandy, until I try to implement my error handling... what happens if something goes wrong on the server side?
I have managed to have the server generate a well-formed XML doc that I parse using the DOM, and I can pop up alerts with detailed status on the error. However...
The newly typed text stays on the cell!!! I don't want this, the change didn't make it into the DB. I want the old text back in there. I had high hopes that event handlers such as onCellValidating or onCellValidated would PREVENT the typed text from being shown if one returned false from their assigned functions. However, this is completely ineffectual. If one returns false from either of these handlers, onCellEditEnding and obj.onCellEditEnded proceed in sequence as if nothing had happened.
Is there a way to tell the grid
"look, NO! This entry doesn't validate! ABORT!" ??
That's what the event handler's name suggests it would do.
More to the point, is there a way to just revert to the old text if the newly-typed one didn't make it into the server? How would you go about this.
And (sorry) one further question: if those event handlers don't do what I think they do, could you briefly exlpain their purpose?
Thanks, and congratulations again on an outstanding product.
QUASAR
Quasar
July 29,