Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>First of all you can change some default options used for add/edit:</p> <pre><code>jQuery.extend(jQuery.jgrid.edit, { ajaxEditOptions: { contentType: "application/json" }, recreateForm: true, serializeEditData: function (postData) { if (postData.exercise_value === undefined) { postData.exercise_value = null; } return JSON.stringify(postData); } }); </code></pre> <p>(where <code>JSON.stringify</code> is the functions defined in <a href="http://www.json.org/js.html" rel="nofollow">http://www.json.org/js.html</a>). Then the data, which will be send to the server, will be JSON encoded. Almost the same settings can be used for the delete</p> <pre><code>jQuery.extend(jQuery.jgrid.del, { ajaxDelOptions: { contentType: "application/json" }, serializeDelData: function (postData) { if (postData.exercise_value === undefined) { postData.exercise_value = null; } return JSON.stringify(postData); } }); </code></pre> <p>Now you can define <code>insertRecord</code> like following</p> <pre><code>[WebMethod, ScriptMethod(ResponseFormat = ResponseFormat.Json)] public int ModifyData (string exercise_value, string oper, string id) { if (String.Compare (id, "_empty", StringComparison.Ordinal) == 0 || String.Compare (oper, "add", StringComparison.Ordinal) == 0) { // TODO: add new item with the exercise_value and return new id // as the method result } else if (String.Compare (oper, "edit", StringComparison.Ordinal) == 0) { // TODO: modify the data identified by the id } else if (String.Compare (oper, "del", StringComparison.Ordinal) == 0) { // TODO: delete the data identified by the id } } </code></pre> <p>You don't wrote which type has <code>exercise_id</code>: integer or string. If you use string ids the code above should be changed a little.</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.
    3. 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