Skip to content
Browse files

Merge pull request #368 from powercat97/master

navSeparatorAdd changed to accept position option like naveButtonAdd.
  • Loading branch information...
2 parents f0cfe71 + 2cd3384 commit 35c1d9c046ecebe3bc6ebe122ad2f2ccc44ae653 @tonytomov committed
Showing with 11 additions and 2 deletions.
  1. +11 −2 js/grid.formedit.js
View
13 js/grid.formedit.js
@@ -2049,7 +2049,8 @@ $.jgrid.extend({
navSeparatorAdd:function (elem,p) {
p = $.extend({
sepclass : "ui-separator",
- sepcontent: ''
+ sepcontent: '',
+ position : "last"
}, p ||{});
return this.each(function() {
if( !this.grid) {return;}
@@ -2057,7 +2058,15 @@ $.jgrid.extend({
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);
+ }
}
});
},

0 comments on commit 35c1d9c

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