Skip to content

Commit

Permalink
Synchronize formatter actions and inlineAdd navigator so that they us…
Browse files Browse the repository at this point in the history
… e common paramaters.

Also in this case the useFormatter parameter shold be set to true
  • Loading branch information
tonytomov committed Dec 5, 2011
1 parent 0ed96fd commit e7355dd
Showing 1 changed file with 32 additions and 0 deletions.
32 changes: 32 additions & 0 deletions js/grid.inlinedit.js
Original file line number Diff line number Diff line change
Expand Up @@ -387,6 +387,38 @@ $.jgrid.extend({
return this.each(function(){
if (!this.grid ) { return; }
var $t = this;
// detect the formatactions column
if(o.addParams.useFormatter === true) {
var cm = $t.p.colModel,i;
for (i = 0; i<cm.length; i++) {
if(cm[i].formatter && cm[i].formatter === "actions" ) {
if(cm[i].formatoptions) {
var defaults = {
keys:false,
onEdit : null,
onSuccess: null,
afterSave:null,
onError: null,
afterRestore: null,
extraparam: {editmode:'inline'},
url: null
},
ap = $.extend( defaults, cm[i].formatoptions );
o.addParams.addRowParams = {
"keys" : ap.keys,
"oneditfunc" : ap.onEdit,
"successfunc" : ap.onSuccess,
"url" : ap.url,
"extraparam" : ap.extraparam,
"aftersavefunc" : ap.afterSavef,
"errorfunc": ap.onError,
"afterrestorefunc" : ap.afterRestore
}
}
break;
}
}
}
if(o.add) {
$($t).jqGrid('navButtonAdd', elem,{
caption : o.addtext,
Expand Down

0 comments on commit e7355dd

Please sign in to comment.