Display nice error message when there is something wrong after ajax request jqgrid

Posted by Niels Ilmer on Stack Overflow See other posts from Stack Overflow or by Niels Ilmer
Published on 2010-05-17T12:59:48Z Indexed on 2010/05/17 13:20 UTC
Read the original article Hit count: 521

Filed under:
|

Hello,

I delete rows with this function:

function deleteRow(){
 rows = jQuery("#category_grid").getGridParam('selarrrow');
 if( rows.length>0){
  jQuery('#category_grid').delGridRow(rows,{
   msg:'Verwijderen geselecteerde rijen?'   
  });
 }else{
  alert("Selecteer eerst een rij om te verwijderen!"); 
 }
}

but when it's fails in my php, server side and a exception is thrown. The errormessage looks not nice. How can i show errotext in the dialog box? or catch an error message after an ajax call?

At the moment the error message looks like: error Status: 'CDbException'. Error code: 500

When i googled i found a event of the delGridRow function called errorTextFormat. Is this the event where i'm looking for? Can someone please give me an example of the implementation of this event?

greetings

niels

© Stack Overflow or respective owner

Related posts about jqgrid

Related posts about callback