qooxdoo
qooxdoo copied to clipboard
Change to qx.ui.table.pane.Pane
Issue: All rows in a table have the same height.
Reason: _getRowsHtml in qx.ui.table.pane.Pane line 470 defines the row height by computing it from rowHeight, which is itself obtained in line 409 from table.getRowHeight().
Suggested solution: Change line 470 from:
rowStyle += ";position:relative;" + rowRenderer.getRowHeightStyle(rowHeight) + "width:100%;";
to:
rowStyle += ";position:relative;" + rowRenderer.getRowHeightStyle(cellInfo.styleHeight) + "width:100%;";
cellInfo.styleHeight is set in line 446 as:
cellInfo.styleHeight = rowHeight;
but the code in line 469 is:
var rowStyle = rowRenderer.createRowStyle(cellInfo);
By using rowInfo.styleHeight, a developer can create his/her own row renderer and change the cellInfo.styleHeight in his/her createRowStyle and change the row height for each row. This should not affect any developer that does not create his/her own renderer. There may be possible issues if a developer has created his/her own renderer and is changing the cellInfo.styleHeight, however I do not see why he/she would be doing that.
Very cool idea. Do you have a working example renderer that demonstrates this working?
Derrell:
Attached are the row and cell renderer I use. I a using a modified qx.ui.table.pane.Pane and attached is a sample table.
The code is not the cleanest as I am new to qooxdoo and like I have said before: "Great package except for the documentation". I have yet to see an example of how to override the cell renderer. Documentation says you need to do it, just does not tell you how to link it in. It has been lots of fun figuring things out, just like going to the dentist every hour. :-)
Derrel:
One more item. The row renderer also has code to support coloring and makes use of a color table elsewhere in the system. You can remove that code or not have a "_color" data field in the data.
@nxproject the "problem" with the table code is that it is old and has only partly been adapted to the new theming system, so some of the appearance things happening in there are not really exemplary for how they are supposed to work in qooxdoo land these days, so if you see things that you think do not match up with how you would expect things to work (all via the appearance property) then this is correct and it would be great to fix it :)
Thanks @nxproject. I'll build this and try to think of potential failure cases, during the weekend. Have you tested it with multiple metacolumns?
Derrell:
-
In the files that I sent, you are seeing code that was just baked and got the one screen that I was working on. As the change was applied to all of the grids generated in the system, and since all grids are being drawn, I would say that the code works. I do not use the qooxdoo compiler as the project is dynamic at runtime,
-
The change that I asked for in qx.ui.table.pane.Pane will fail for the condition where the developer changes cellInfo.styleHeight in a custom renderer in the createRowStyle call. This could be solved by adding an extra option in the Pane configuration to turn on/off (default). As I am not up to qooxdoo "way of doing things", I leave it up to you.
-
I do not know what a "metacolumn" is in qooxdoo terms. There are no entries in the qooxdoo Documentation Release 6.0.0-alpha dated Dec 18, 2018 and the qooxdoo API Documentation references a metadata column count and how to set/get it, but does not explain what it is or how to use it.
-
I will be adding code to the row renderer so I can turn on the autosize for specific columns in today's session. This is the extent of what I need for my project.
I'll check it out. Thanks again.
I've moved the discussion of metacolumns to gitter, where I just mentioned you.
oetiker:
What I brought forward is not an issue or problem. I have not run into any issues with the methodology used in qooxdoo overall, in fact I have been able to use qooxdoo to make an existent ExtJS project much better in what I consider record time.
I will repeat, and keep repeating my statement regarding qooxdoo: "Great package except for the documentation". As I am a developer myself, I understand the amount of "non-productive" time that documentation takes and that this is an open source project and that you all have a real (income producing) life elsewhere, so do not take it the wrong way.
I have code older than probably you that is still running. The project that I am working on, which is for self-gratification, begun in 1985 and the user manual for the first commercial use has many sections that apply to todays incarnation.
Derrell:
As you seemed to be interested, I am attaching the working versions of both qx.ui.table.pane.Pane and qx.ui.table.pane.Scroller.
Note: As I do not use the qooxdoo compiler because of the way my project is designed, I am including modified versions of the files as they sit in the packages5.js file. You can search for ECANDIDUS and see what the changes are. Unlike my earlier post, I did not go back and change the code in the source files.
You are welcome to use these in any way that you deem proper.
So I guess this wasn't just those few simple changed lines in Pane.js. Most of the changes are in Scroller.js, and it's not clear what they're doing. If you would create a pull request with your changes (preferably with some comments explaining what the changes do), it'd be GREAT to have variable row height in the Table widget... but without understanding the code changes, and having them in a branch where I can try it out and play with it, it's difficult to make use of this.
(BTW, I think you have some typo bugs. There are a couple of places in scroller.js that reference undeclared variable ec_Row that should, I believe, be referencing ecRow (no underscore).)
Derrell:
Yes, there are typos as I was trying to keep two copies, the package5.js and the source code from the unpackaged. I finally gave up as I only need the packaged changes which is what I run.
I will be more than happy to document the changes in detail. Be aware that I am providing my implementation, not a general purpose solution. The latter I most likely will not be able to do as my experience with qooxdoo is limited to about four months so my knowledge of how others are using it is non-existent.
You will also have to map back from the package.js code to the source code. The way that I work with third party products and changes that I make, is that I wrap the change between // ECANDIDUS yyyy-mm-dd and // END ECANDIDUS comment lines and comment out the original code. The commented original code is what you can use to match against your non-packaged source code. As I have walked other over this, I do not foresee issues.
I will also have to include changes to the row renderer and cell renderer, as those are also needed.
Derrell:
Here you go. Let me know if this works for you.
Uploading VarHeight.zip…