Skip to content
This repository
Browse code

Update js/grid.common.js

add support of `editoptions.postData` and `ajaxSelectOptions.postData` for editing.
  • Loading branch information...
commit 3e2a0ada37357e717f17acfcfd0289a7a0800427 1 parent 2f0eb25
Dr. Oleg Kiriljuk OlegKi authored

Showing 1 changed file with 9 additions and 1 deletion. Show diff stats Hide diff stats

  1. +9 1 js/grid.common.js
10 js/grid.common.js
@@ -181,7 +181,6 @@ $.extend($.jgrid,{
181 181 try{$(':input:visible',selector)[0].focus();}catch(_){}
182 182 }
183 183 },
184   -
185 184 info_dialog : function(caption, content,c_b, modalopt) {
186 185 var mopt = {
187 186 width:290,
@@ -340,10 +339,19 @@ $.extend($.jgrid,{
340 339 $(elem).attr("aria-multiselectable","true");
341 340 } else { msl = false; }
342 341 if(options.dataUrl !== undefined) {
  342 + var rowid = options.name ? String(options.id).substring(0, String(options.id).length - String(options.name).length - 1) : String(options.id),
  343 + postData = options.postData || ajaxso.postData;
  344 +
  345 + if ($t.p && $t.p.idPrefix) {
  346 + rowid = $.jgrid.stripPref($t.p.idPrefix, rowid);
  347 + } else {
  348 + postData = undefined; // don't use postData for searching from jqFilter. One can implement the feature in the future if required.
  349 + }
343 350 $.ajax($.extend({
344 351 url: options.dataUrl,
345 352 type : "GET",
346 353 dataType: "html",
  354 + data: $.isFunction(postData) ? postData.call($t, rowid, vl, String(options.name)) : postData,
347 355 context: {elem:elem, options:options, vl:vl},
348 356 success: function(data){
349 357 var a, ovm = [], elem = this.elem, vl = this.vl,

0 comments on commit 3e2a0ad

Please sign in to comment.
Something went wrong with that request. Please try again.