Permalink
Browse files

Merge pull request #368 from powercat97/master

navSeparatorAdd changed to accept position option like naveButtonAdd.
  • Loading branch information...
tonytomov committed Sep 27, 2012
2 parents f0cfe71 + 2cd3384 commit 35c1d9c046ecebe3bc6ebe122ad2f2ccc44ae653
Showing with 11 additions and 2 deletions.
  1. +11 −2 js/grid.formedit.js
View
@@ -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);
+ }
}
});
},

0 comments on commit 35c1d9c

Please sign in to comment.