Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p><a href="http://www.trirand.com/jqgridwiki/doku.php?id=wiki%3ainline_editing#editrow" rel="nofollow">editRow</a> function has the following parameters:</p> <pre><code>jQuery("#grid_id").jqGrid('editRow',rowid, keys, oneditfunc, succesfunc, url, extraparam, aftersavefunc,errorfunc, afterrestorefunc); </code></pre> <p>You current code use <code>succesfunc</code> only. It is important, that the server return some <a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.4" rel="nofollow">HTTP status code</a> which are grater or equal to 400. Then the server response will be interpret as error by <a href="http://api.jquery.com/jQuery.ajax/" rel="nofollow">jQuery.ajax</a> and jqGrid. To display any error message or for any other action in case of error you should use <strong>errorfunc</strong> parameter of the <a href="http://www.trirand.com/jqgridwiki/doku.php?id=wiki%3ainline_editing#editrow" rel="nofollow">editRow</a> function.</p> <p>One more small remark. You should use <a href="http://api.jquery.com/jQuery.parseJSON/" rel="nofollow">jQuery.parseJSON</a> or <code>JSON.parse</code> instead of the usage of <code>eval</code>.</p> <p><strong>UPDATED</strong>: I answer here on your questions from the comment. Why it is important to use <code>errorfunc</code> and not always <code>succesfunc</code>? There are different reason. If you fill the box having the label sugar with the salt, it could has bitter consequences in your kitchen. Exactly the same is in case of wrong usage different callback functions of the <code>editRow</code>. I can give just some examples:</p> <ul> <li><strong>Errors can be produced by your server part not only explicitly</strong>. Your web server can throw an exception from any other your code like SQL Queries. Even if you catch all such errors, the input data sent to the server having wrong format or having other error can produce the response with the failed HTTP status and the error description. Such error response will produce your web server of the framework which you use (ASP.NET, PHP and so on).</li> <li>jQuery used by jqGrid should know which server response is successful and which is the error response. Frequently error response has <strong>another format</strong>, so there <strong>will not be parsed</strong> by jQuery.ajax (jQuery will not convert it from JSON string to the object).</li> <li>It is important for jqGrid to know whether the response was successful or not. In case of error jqGrid do one things after the response, in case of successful response another things. Different events will be called, different messages will be shown and so on.</li> </ul> <p>What I wrote about the working with errors is the general rule. jqGrid defines many events in case of errors. For example <a href="http://www.trirand.com/jqgridwiki/doku.php?id=wiki%3aevents#list_of_events" rel="nofollow">loadError</a> for the grid filling, <a href="http://www.trirand.com/jqgridwiki/doku.php?id=wiki%3aform_editing" rel="nofollow">errorTextFormat</a> for all types of form editing, <a href="http://www.trirand.com/jqgridwiki/doku.php?id=wiki%3acell_editing#events" rel="nofollow">errorCell</a> for the cell editing and <a href="http://www.trirand.com/jqgridwiki/doku.php?id=wiki%3ainline_editing#editrow" rel="nofollow">errorfunc</a> for inline editing. All the methods are based on the fact that in case of error the server response has the HTTP status code which corresponds the error (are grater or equal to 400).</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload