error text returning in dataProcessor

I am using data processor to store and fetch data to/from a php program.

In response to the posted info, the program returns:

<data><action type='$accion' sid='$id' tid='$id'></action></data>

And when an error occured, I returns:

<data><action type='error' sid='$id' tid='$id' >$errortext</action></data>

Is there any way to make the error reported in an alert box or some other way?
Is there a way for removing the new item from the scheduler if the save process returned an error?

Is there any way to make the error reported in an alert box or some other way?

dp.attachEvent(“onAfterUpdate”, function(sid,tid,action,tag){
if (action == “error”)
alert(tag.firstChild.data);
})

Is there a way for removing the new item from the scheduler
Similar to above code, you can exec any calls against the grid from onAfterUpdate callback, sid parameter will contain ID of item in question.

Thank you very much. It worked perfectly. In case other people need this, the resulting code is this:

The php program that writes the data returns:

<data><action type='$accion' sid='$id' tid='$insertid'></action></data>

where $id is the id of the record sent and $insertid is the id of the actually written record (in my case it is obtained from mysql_insert_id()

If there is an error:

<data><action type='error' sid='$id' tid='$insertid'>$error_text</action></data>

In this case, $insertid is blank when it is a new record and it was not written. If it is editing or moving a record, $insertid = $id.

At the scheduler, the working code is this:

[code]dp.attachEvent(‘onAfterUpdate’, function(sid,action,tid,tag){
if (action == ‘error’){
var text=tag.firstChild.data;
if (text==’’) text=‘Error saving data’;
alert(text);
}

    //always reload the saved item in order to ensure the colors are ok
    if (tid!='')
         scheduler.load('savedata.php?uid='+scheduler.uid()+'&sid='+tid);

    else //if tid is empty, the item was never written
         scheduler.deleteEvent(sid);
    })

[/code]