| Summary: | [Table] Fixed Table Columns prevent Drag&Drop | ||||||
|---|---|---|---|---|---|---|---|
| Product: | [RT] RAP | Reporter: | Missing name Mising name <Rene.Brandstetter> | ||||
| Component: | RWT | Assignee: | Project Inbox <rap-inbox> | ||||
| Status: | RESOLVED FIXED | QA Contact: | |||||
| Severity: | normal | ||||||
| Priority: | P2 | CC: | andreas.r.fischl.work, tbuschto | ||||
| Version: | unspecified | ||||||
| Target Milestone: | 2.3 M3 | ||||||
| Hardware: | PC | ||||||
| OS: | All | ||||||
| Whiteboard: | |||||||
| Attachments: |
|
||||||
Should be a relatively easy to make the basics work, though there may be some difficulties with the drag feedback. (In reply to Tim Buschtoens from comment #1) > Should be a relatively easy to make the basics work, though there may be > some difficulties with the drag feedback. Yes, you are right the fix is easy it just adding the following method to the "rwt/widgets/util/GridRowContainerWrapper.js" to the prototype definition: rwt.widgets.util.GridRowContainerWrapper.prototype = { ... indexOf : function( vChild ){ var index = this._container[ 0 ].indexOf( vChild ); if( index < 0 ){ index = this._container[ 1 ].indexOf( vChild ); } return index; }, ... } I will provide a gerrit review in the next couple days. (In reply to comment #2) > Yes, you are right the fix is easy it just adding the following method to the > "rwt/widgets/util/GridRowContainerWrapper.js" to the prototype definition: > > rwt.widgets.util.GridRowContainerWrapper.prototype = { > ... > > indexOf : function( vChild ){ > var index = this._container[ 0 ].indexOf( vChild ); > if( index < 0 ){ > index = this._container[ 1 ].indexOf( vChild ); > } > return index; > }, > > ... > > } > > > I will provide a gerrit review in the next couple days. Is it better to simply add "indexOf" to rwt.widgets.util.GridRowContainerWrapper._CONTAINER_GETTER_DELEGATES. In both containers the indexOf function should return the same index. René, could you try if this works? (In reply to Ivan Furnadjiev from comment #3) > (In reply to comment #2) > > Yes, you are right the fix is easy it just adding the following method to the > > "rwt/widgets/util/GridRowContainerWrapper.js" to the prototype definition: > > > > rwt.widgets.util.GridRowContainerWrapper.prototype = { > > ... > > > > indexOf : function( vChild ){ > > var index = this._container[ 0 ].indexOf( vChild ); > > if( index < 0 ){ > > index = this._container[ 1 ].indexOf( vChild ); > > } > > return index; > > }, > > > > ... > > > > } > > > > > > I will provide a gerrit review in the next couple days. > Is it better to simply add "indexOf" to > rwt.widgets.util.GridRowContainerWrapper._CONTAINER_GETTER_DELEGATES. In > both containers the indexOf function should return the same index. René, > could you try if this works? Hi Ivan, I've tried it and this will not work because the rwt.widgets.util.GridRowContainerWrapper._CONTAINER_GETTER_DELEGATES are only calling the first container (=the fixed columns) and the row could either be in the first container or the second one (=the scrollable columns). So if you start drag in one of the scrollable columns the indexOf() will always return -1 instead of the index which could be gained by the second container. I see. Thanks for the explanation. I've added the mentioned method to the rwt/widgets/util/GridRowContainerWrapper.js and pushed it to Gerrit: https://git.eclipse.org/r/24033 Was fixed in commit 985917cf72e3c4476f8b49788d0cacf4fa29b48a as suggested, test added in commit 7baeef4bf4aa09f9be1ef38f139aa8629aecb3d5. |
Created attachment 241226 [details] full error present by firefox If you want to add Drag&Drop support to a Table which uses the "Fixed Table Columns" feature you gain a JavaScript error with the message: "this._tree._rowContainer.indexOf is not a function". The reason for this is located in the used implementation of the _rowContainer which is usually an instance of "rwt.widgets.base.GridRowContainer" and there and "indexOf" exists. But if you use the "Fixed Table Columns" feature the _rowContainer is an instance of "rwt.widgets.util.GridRowContainerWrapper" which doesn't has this method. (As an attachment I added the full error output retrieved on a firefox because it contains the better details, but all other browser like chrome and IE have the same error.)