Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RTL direction jtable with rtl column resizable support added #1996

Closed
wants to merge 21 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
ab58738
RTL direction support added
sheryever Oct 9, 2016
1348a50
RTL column resizable direction support added
sheryever Oct 9, 2016
86392ee
RTL column resizable direction support added
sheryever Oct 9, 2016
2ecbfa1
RTL column resizable direction support added
sheryever Oct 9, 2016
9c29012
RTL column resizable direction support added
sheryever Oct 9, 2016
d8e3c0c
RTL column resizable direction support added
sheryever Oct 9, 2016
7403d5b
RTL column resizable direction support added
sheryever Oct 9, 2016
594be3c
RTL column resizable direction support added
sheryever Oct 9, 2016
232adf9
RTL column resizable direction support added
sheryever Oct 9, 2016
6ec389c
RTL column resizable direction support added
sheryever Oct 9, 2016
09d8193
RTL column resizable direction support added
sheryever Oct 9, 2016
2c4fadd
RTL column resizable direction support added
sheryever Oct 9, 2016
64266bc
RTL column resizable direction support added
sheryever Oct 9, 2016
77dbcb7
RTL column resizable direction support added
sheryever Oct 9, 2016
c5251a9
RTL column resizable direction support added
sheryever Oct 9, 2016
d4b9fd7
RTL column resizable direction support added
sheryever Oct 9, 2016
dbeef79
RTL column resizable direction support added
sheryever Oct 9, 2016
edc942e
RTL column resizable direction support added
sheryever Oct 9, 2016
4912c97
RTL column resizable direction support added
sheryever Oct 9, 2016
d07303e
RTL column resizable direction support added
sheryever Oct 9, 2016
552a6fb
RTL column resizable direction optimized
sheryever Oct 10, 2016
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 11 additions & 3 deletions dev/jquery.jtable.dynamiccolumns.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/************************************************************************
/************************************************************************
* DYNAMIC COLUMNS extension for jTable *
* (Show/hide/resize columns) *
*************************************************************************/
Expand All @@ -22,7 +22,8 @@
options: {
tableId: undefined,
columnResizable: true,
columnSelectable: true
columnSelectable: true,
rtl: false
},

/************************************************************************
Expand Down Expand Up @@ -268,9 +269,14 @@
*************************************************************************/
_makeColumnResizable: function ($columnHeader) {
var self = this;

if (self.options.rtl) {
self._$mainContainer.parent().attr('dir', "rtl");
}

//Create a handler to handle mouse click event
$('<div />')
.attr('dir', self.options.rtl ? "rtl": "")
.addClass('jtable-column-resize-handler')
.appendTo($columnHeader.find('.jtable-column-header-container')) //Append the handler to the column
.mousedown(function (downevent) { //handle mousedown event for the handler
Expand Down Expand Up @@ -319,7 +325,9 @@

//Calculate new widths in pixels
var mouseChangeX = upevent.pageX - self._currentResizeArgs.mouseStartX;
var currentColumnFinalWidth = self._normalizeNumber(self._currentResizeArgs.currentColumnStartWidth + mouseChangeX, self._currentResizeArgs.minWidth, self._currentResizeArgs.maxWidth);
var currentColumnNewWidth = (self.options.rtl ? self._currentResizeArgs.currentColumnStartWidth - mouseChangeX : self._currentResizeArgs.currentColumnStartWidth + mouseChangeX);
var currentColumnFinalWidth = self._normalizeNumber(columnNewWidth, self._currentResizeArgs.minWidth, self._currentResizeArgs.maxWidth)
//var currentColumnFinalWidth = self._normalizeNumber(self._currentResizeArgs.currentColumnStartWidth + mouseChangeX, self._currentResizeArgs.minWidth, self._currentResizeArgs.maxWidth);
var nextColumnFinalWidth = $nextColumnHeader.outerWidth() + (self._currentResizeArgs.currentColumnStartWidth - currentColumnFinalWidth);

//Calculate widths as percent
Expand Down
4 changes: 4 additions & 0 deletions lib/themes/basic/jtable_basic.css
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,10 @@ div.jtable-main-container table.jtable thead th.jtable-column-header div.jtable-
z-index: 2;
cursor: col-resize;
}
div.jtable-main-container table.jtable thead th.jtable-column-header div.jtable-column-header-container div[dir="rtl"].jtable-column-resize-handler {
right: auto;
left: -8px !important;
}
div.jtable-main-container table.jtable thead th.jtable-command-column-header {
text-align: center;
}
Expand Down
7 changes: 7 additions & 0 deletions lib/themes/jtable_theme_base.less
Original file line number Diff line number Diff line change
Expand Up @@ -217,6 +217,13 @@
z-index: 2;
cursor: col-resize;
}

div[dir="rtl"].jtable-column-resize-handler
{
right: auto;
left: -8px !important;
}

}
}

Expand Down
4 changes: 4 additions & 0 deletions lib/themes/lightcolor/blue/jtable.css
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,10 @@ div.jtable-main-container table.jtable thead th.jtable-column-header div.jtable-
z-index: 2;
cursor: col-resize;
}
div.jtable-main-container table.jtable thead th.jtable-column-header div.jtable-column-header-container div[dir="rtl"].jtable-column-resize-handler {
right: auto;
left: -8px !important;
}
div.jtable-main-container table.jtable thead th.jtable-command-column-header {
text-align: center;
}
Expand Down
4 changes: 4 additions & 0 deletions lib/themes/lightcolor/gray/jtable.css
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,10 @@ div.jtable-main-container table.jtable thead th.jtable-column-header div.jtable-
z-index: 2;
cursor: col-resize;
}
div.jtable-main-container table.jtable thead th.jtable-column-header div.jtable-column-header-container div[dir="rtl"].jtable-column-resize-handler {
right: auto;
left: -8px !important;
}
div.jtable-main-container table.jtable thead th.jtable-command-column-header {
text-align: center;
}
Expand Down
4 changes: 4 additions & 0 deletions lib/themes/lightcolor/green/jtable.css
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,10 @@ div.jtable-main-container table.jtable thead th.jtable-column-header div.jtable-
z-index: 2;
cursor: col-resize;
}
div.jtable-main-container table.jtable thead th.jtable-column-header div.jtable-column-header-container div[dir="rtl"].jtable-column-resize-handler {
right: auto;
left: -8px !important;
}
div.jtable-main-container table.jtable thead th.jtable-command-column-header {
text-align: center;
}
Expand Down
4 changes: 4 additions & 0 deletions lib/themes/lightcolor/orange/jtable.css
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,10 @@ div.jtable-main-container table.jtable thead th.jtable-column-header div.jtable-
z-index: 2;
cursor: col-resize;
}
div.jtable-main-container table.jtable thead th.jtable-column-header div.jtable-column-header-container div[dir="rtl"].jtable-column-resize-handler {
right: auto;
left: -8px !important;
}
div.jtable-main-container table.jtable thead th.jtable-command-column-header {
text-align: center;
}
Expand Down
4 changes: 4 additions & 0 deletions lib/themes/lightcolor/red/jtable.css
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,10 @@ div.jtable-main-container table.jtable thead th.jtable-column-header div.jtable-
z-index: 2;
cursor: col-resize;
}
div.jtable-main-container table.jtable thead th.jtable-column-header div.jtable-column-header-container div[dir="rtl"].jtable-column-resize-handler {
right: auto;
left: -8px !important;
}
div.jtable-main-container table.jtable thead th.jtable-command-column-header {
text-align: center;
}
Expand Down
4 changes: 4 additions & 0 deletions lib/themes/metro/blue/jtable.css
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,10 @@ div.jtable-main-container table.jtable thead th.jtable-column-header div.jtable-
z-index: 2;
cursor: col-resize;
}
div.jtable-main-container table.jtable thead th.jtable-column-header div.jtable-column-header-container div[dir="rtl"].jtable-column-resize-handler {
right: auto;
left: -8px !important;
}
div.jtable-main-container table.jtable thead th.jtable-command-column-header {
text-align: center;
}
Expand Down
4 changes: 4 additions & 0 deletions lib/themes/metro/brown/jtable.css
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,10 @@ div.jtable-main-container table.jtable thead th.jtable-column-header div.jtable-
z-index: 2;
cursor: col-resize;
}
div.jtable-main-container table.jtable thead th.jtable-column-header div.jtable-column-header-container div[dir="rtl"].jtable-column-resize-handler {
right: auto;
left: -8px !important;
}
div.jtable-main-container table.jtable thead th.jtable-command-column-header {
text-align: center;
}
Expand Down
4 changes: 4 additions & 0 deletions lib/themes/metro/crimson/jtable.css
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,10 @@ div.jtable-main-container table.jtable thead th.jtable-column-header div.jtable-
z-index: 2;
cursor: col-resize;
}
div.jtable-main-container table.jtable thead th.jtable-column-header div.jtable-column-header-container div[dir="rtl"].jtable-column-resize-handler {
right: auto;
left: -8px !important;
}
div.jtable-main-container table.jtable thead th.jtable-command-column-header {
text-align: center;
}
Expand Down
4 changes: 4 additions & 0 deletions lib/themes/metro/darkgray/jtable.css
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,10 @@ div.jtable-main-container table.jtable thead th.jtable-column-header div.jtable-
z-index: 2;
cursor: col-resize;
}
div.jtable-main-container table.jtable thead th.jtable-column-header div.jtable-column-header-container div[dir="rtl"].jtable-column-resize-handler {
right: auto;
left: -8px !important;
}
div.jtable-main-container table.jtable thead th.jtable-command-column-header {
text-align: center;
}
Expand Down
4 changes: 4 additions & 0 deletions lib/themes/metro/darkorange/jtable.css
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,10 @@ div.jtable-main-container table.jtable thead th.jtable-column-header div.jtable-
z-index: 2;
cursor: col-resize;
}
div.jtable-main-container table.jtable thead th.jtable-column-header div.jtable-column-header-container div[dir="rtl"].jtable-column-resize-handler {
right: auto;
left: -8px !important;
}
div.jtable-main-container table.jtable thead th.jtable-command-column-header {
text-align: center;
}
Expand Down
4 changes: 4 additions & 0 deletions lib/themes/metro/green/jtable.css
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,10 @@ div.jtable-main-container table.jtable thead th.jtable-column-header div.jtable-
z-index: 2;
cursor: col-resize;
}
div.jtable-main-container table.jtable thead th.jtable-column-header div.jtable-column-header-container div[dir="rtl"].jtable-column-resize-handler {
right: auto;
left: -8px !important;
}
div.jtable-main-container table.jtable thead th.jtable-command-column-header {
text-align: center;
}
Expand Down
8 changes: 8 additions & 0 deletions lib/themes/metro/lightgray/jtable.css
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,14 @@ div.jtable-main-container table.jtable thead th.jtable-column-header div.jtable-
z-index: 2;
cursor: col-resize;
}
div.jtable-main-container table.jtable thead th.jtable-column-header div.jtable-column-header-container div[dir="rtl"].jtable-column-resize-handler {
right: auto;
left: -8px !important;
}
div.jtable-main-container table.jtable thead th.jtable-column-header div.jtable-column-header-container div[dir="rtl"].jtable-column-resize-handler {
right: auto;
left: -8px !important;
}
div.jtable-main-container table.jtable thead th.jtable-command-column-header {
text-align: center;
}
Expand Down
4 changes: 4 additions & 0 deletions lib/themes/metro/pink/jtable.css
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,10 @@ div.jtable-main-container table.jtable thead th.jtable-column-header div.jtable-
z-index: 2;
cursor: col-resize;
}
div.jtable-main-container table.jtable thead th.jtable-column-header div.jtable-column-header-container div[dir="rtl"].jtable-column-resize-handler {
right: auto;
left: -8px !important;
}
div.jtable-main-container table.jtable thead th.jtable-command-column-header {
text-align: center;
}
Expand Down
4 changes: 4 additions & 0 deletions lib/themes/metro/purple/jtable.css
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,10 @@ div.jtable-main-container table.jtable thead th.jtable-column-header div.jtable-
z-index: 2;
cursor: col-resize;
}
div.jtable-main-container table.jtable thead th.jtable-column-header div.jtable-column-header-container div[dir="rtl"].jtable-column-resize-handler {
right: auto;
left: -8px !important;
}
div.jtable-main-container table.jtable thead th.jtable-command-column-header {
text-align: center;
}
Expand Down
4 changes: 4 additions & 0 deletions lib/themes/metro/red/jtable.css
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,10 @@ div.jtable-main-container table.jtable thead th.jtable-column-header div.jtable-
z-index: 2;
cursor: col-resize;
}
div.jtable-main-container table.jtable thead th.jtable-column-header div.jtable-column-header-container div[dir="rtl"].jtable-column-resize-handler {
right: auto;
left: -8px !important;
}
div.jtable-main-container table.jtable thead th.jtable-command-column-header {
text-align: center;
}
Expand Down