Skip to content

Commit

Permalink
Merge pull request #368 from powercat97/master
Browse files Browse the repository at this point in the history
navSeparatorAdd changed to accept position option like naveButtonAdd.
  • Loading branch information
tonytomov committed Sep 27, 2012
2 parents f0cfe71 + 2cd3384 commit 35c1d9c
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions js/grid.formedit.js
Expand Up @@ -2049,15 +2049,24 @@ $.jgrid.extend({
navSeparatorAdd:function (elem,p) {
p = $.extend({
sepclass : "ui-separator",
sepcontent: ''
sepcontent: '',
position : "last"
}, p ||{});
return this.each(function() {
if( !this.grid) {return;}
if( typeof elem === "string" && elem.indexOf("#") !== 0) {elem = "#"+$.jgrid.jqID(elem);}
var findnav = $(".navtable",elem)[0];
if(findnav) {
var sep = "<td class='ui-pg-button ui-state-disabled' style='width:4px;'><span class='"+p.sepclass+"'></span>"+p.sepcontent+"</td>";
$("tr",findnav).append(sep);
if (p.position === 'first') {
if (findnav.rows[0].cells.length === 0) {
$("tr", findnav).append(sep);
} else {
$("tr td:eq(0)", findnav).before(sep);
}
} else {
$("tr", findnav).append(sep);
}
}
});
},
Expand Down

0 comments on commit 35c1d9c

Please sign in to comment.