-
Notifications
You must be signed in to change notification settings - Fork 505
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
Conversation
Support added for right to left direction languages like: Arabi, Urdu etc
Thank you for the contribution. I'll review it soon. |
The code is optimized. In last code of this file, I just created one extra chunk code to avoid any kind of code conflict. In this commit the same code of jtable 2.4.0 is just tweaked to support rtl. these line added. ```Javascript if (self.options.rtl) { self._$mainContainer.parent().attr('dir', "rtl"); } ``` these line updated ```javascript 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); ```
RTL column resizable direction optimized The code is optimized. In last code of this file, I just created one extra chunk code to avoid any kind of code conflict. In this commit the same code of jtable 2.4.0 is just tweaked to support rtl. these line added. if (self.options.rtl) {
self._$mainContainer.parent().attr('dir', "rtl");
} these line updated 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); |
@hikalkan ٍ@sheryever wouldn't it be better if the rtl is automatically set? document.dir then apply right to left specs |
@mosid in the start i was doing that but in my own application, there are some scenario where i need LTR jtable in RTL page. But you can do something like @hikalkan I am sorry. I want to close this pull request and create another pull request which will have the complete rtl css with one commit. this pull request only have column header css while there are some other elements which are required to be fixed. Header resizing also have a minor issue, that header resize limit is calculated from left column which is wrong. Questing: Do i really need to fix the css in all css files in the github source code, while we have the less files in our code? I will prefer the less file with a |
Resizable column support added for right to left direction languages like: Arabic, Urdu etc.
User just need to set a new option
rtl: true
table direction will be change and column resizing will also support RTL direction.dev/jquery.jtable.dynamiccolumns.js, all required css and less files updated.