allow to resize all columns (no need to leave out the last one) and use pageX instead of clientX to take into account an optional scrollbar, if grid is to wide

This commit is contained in:
Ralf Becker 2013-02-06 16:32:18 +00:00
parent 898b020fbf
commit 99eea070bb
2 changed files with 10 additions and 12 deletions

View File

@ -378,15 +378,13 @@ var et2_dataview = Class.extend({
.append(cont)
.appendTo(this.headTr);
// Every column but last can be resized // TODO: This won't work as the last column could be hidden
if(i < this.columns.length-1) {
var enc_column = self.columnMgr.getColumnById(col.id);
et2_dataview_makeResizeable(column, function(_w) {
this.set_width(_w + "px");
self.columnMgr.updated = true;
self.updateColumns();
}, enc_column);
}
// make column resizable
var enc_column = self.columnMgr.getColumnById(col.id);
et2_dataview_makeResizeable(column, function(_w) {
this.set_width(_w + "px");
self.columnMgr.updated = true;
self.updateColumns();
}, enc_column);
// Store both nodes in the columnNodes array
this.columnNodes.push({

View File

@ -63,7 +63,7 @@
.bind("mousemove", function(e) {
didResize = true;
resizeWidth = Math.max(e.clientX - left + RESIZE_ADD,
resizeWidth = Math.max(e.pageX - left + RESIZE_ADD,
RESIZE_MIN_WIDTH);
helper.css("width", resizeWidth + "px");
})
@ -107,12 +107,12 @@
// Bind the "mousemove" event in the "resize" namespace
_elem.bind("mousemove.resize", function(e) {
_elem.css("cursor", inResizeRegion(e.clientX, _elem) ? "ew-resize" : "auto");
_elem.css("cursor", inResizeRegion(e.pageX, _elem) ? "ew-resize" : "auto");
});
// Bind the "mousedown" event in the "resize" namespace
_elem.bind("mousedown.resize", function(e) {
if (inResizeRegion(e.clientX, _elem))
if (inResizeRegion(e.pageX, _elem))
{
// Start the resizing
startResize(outerTable, _elem, function(_w) {