-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
1 addition
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ade9106
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hello Tony!
I see that you works on the
setGroupHeaders
implementation. I worked yesterday also on the problem. So I decide, that it can be helpful if you see in which direction I worked. You can see here the current state. The most problems are solve. One have to make changes in theremapColumns
mostly. The modified version of jqGrid modules are grid.base.js and grid.custom.js. I fixed small problem withresizable: false
columns. I save the original value of thewidth
parameter inwidthOrg
to hold the grid without horizontal scrolling after the column re-sizing if the grid was created without any fixed width value. Moreover I hope that I changed the problem withshrinkToFit: true
correctly. The settingforceFit:true
should also work now. By the way my changes are implied also for the standard grids (without multiline headers). I had to add one more parameter insetGridWidth
to makeshrinkToFit
work correct in case of column resizing. The standard setting which I used to use isshrinkToFit: false
, so please verify whether I did the changes like as should be.Moreover I extended
$("#list")[0].grid
object with additional information. Additionally I extendedcolModel
withgroupHeader
. Look additionally in thegrid.colIndexByName
map. I think it could be helpful in many places in the jqGrid.I stop working on jqGrid for some hours to allow you to examine my changes and to decide what which way to choose.
Please look additionally the part where I increase the size of "span.ui-jqgrid-resize" and adjust position of "div.ui-jqgrid-sortable" inside of the column headers. I think one could find the better way to have full height of the "span.ui-jqgrid-resize". My current implementation work, but I don't like it really. What I additionally not like is the constants like
"padding-top": "2px", height: "19px"
in the code. Probably one can more use CSS classes, but the usage of "!important" attribute for resizing in the current jqGrid implementation of jqGrid (I mean your existing code) makes difficult to change the height of the span.Best regards
Oleg
ade9106
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hello Oleg,
Thanks I will look right now in the changes.
The VERY IMPORTANT problem for me is how to restore the original header when useColSpanStyle is set to true using the destroyGridHeader method.
The is the most important for me. All other problems are at second place.
Regards
Tony
ade9106
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oleg,
When we have a correct working destroyGroupHEader (in booth cases) then all other thing like show/hide cols, soratble columns and etc will work, since we will destroy the header before these actions and apply it after them
Regards
Tony
ade9106
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK Tony, I am back at home now and will look your version of the code. I will look and try to modify
destroyGridHeader
method. In general I looked on thesetGroupHeaders
method mostly as on the method which will be called internally during jqGrid initialization. One can make it public, but to permit to call it once. I thought that one don't need to create or destroy the grouping header dynamically. The parameters ofsetGroupHeaders
method could be parameters of jqGrid in the final implementation. In the most cases either one needs multiline headers in the grid at the beginning or one don't not need multiline headers at all. It's exactly like one currently can't insert/delete new column in the grid dynamically. In the same way one could be not able to manipulate by columns headers.Nevertheless I will read your version of the
destroyGridHeader
and will try to fix the problem which probably exist in the current implementation. I will let you known after I progress in the subject.Regards
Oleg
ade9106
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi Tony,
I modified the code of
destroyGroupHeader
method in the version which I posted you before. The same code with minimal modifications will work in your version too. In the file you can find my current implementation of thedestroyGroupHeader
method. You can use the demo to test it. I included in the code ofsetGroupHeaders
additionally simple test whether the method will be called not the first time. In the case will be done nothing.I will examine your version of the code and will fix the code of
remapColumns
.Regards
Oleg
ade9106
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
By the way you can use the demo to test what work and what still not work in the current code.
Regards
Oleg
ade9106
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hello Tony,
in the next version of the demo the most important problems in the
remapColumns
are solved now. There are still some small problems (see comment with TODO which I not yet done), but because tomorrow I will have to work on other things I decide post the current state.Best regards
Oleg
ade9106
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hello Oleg,
I do not think that currently sortable columns should be compatible with group header - too complicated and too much code.
My goal is to make this simple as possible and do not put a ton of other grid options and colmodel additions.
For now I plan to stay on this variant making just some fixes.
I have tested with show/hide column and it work ok. Rtl is working ok too.
Will make other tests tomorrow
What do you think about this?
Tony
ade9106
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hello Tony,
I like also short and good readable code, but first of all one should make the code work correctly and then simplify/improve it. At the beginning I didn't want to implement column resorting at all, but then I found one problem. The only official supported column hider/shower dialog is
columnChooser
and it has one important problem. If some hidden column exist (like Tax or Id columns in the demo) and one want just to show the hidden columns thecolumnChooser
adds the columns at the end of the column list and not at the original position. This behavior makes the implementation ofremapColumns
as required.By the way. The current implementation has one bug which I didn't yet fixed. To reproduce the bug one should do the following steps in the demo:
useColSpanStyle:true
columnChooser
move the "Date" column between "Shipping" and "Notes" and click OK.columnChooser
move the "Date" column between "Total" and "Closed" and click OK. If any hidden column exists in the bottom header row (like "Tax"), the header movement work incorrect.I have to drive to my customer now. If you would have time you can examine the problem. It would be additionally very good if you could change the behavior of the
columnChooser
so that it places the hidden column at it's original position if the user just click on the "+" on the right of the hidden column.Best regards
Oleg
ade9106
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oleg,
My opinion is - sfter every such action including - show/hide/ remapcolumns/ columnChosser and etc we should apply destroy and rebuild again the group header after this action finished (like I do in showHideColumns)- simple like KISS.
Regards
ade9106
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tony,
I thought about the way. I agree that it could be pragmatical way for the first step. The disadvantage of the way is in the customization. If one set the column text of some other column property dynamically then all the settings will be discarded. So for the standard grid destroying and rebuilding of the grid headers could be good pragmatical way, but it could have some important disadvantages in more complex scenarios. Inside of
destroyGroupHeader
I thought about the problem and so tried I move existing<th>
elements. So many kind of customization will be hold, but other will be do destroyed.I agree, that the way eliminate many problems. Probably I though about the possible problems which are not exist too seldom. Introduction an additional event
afterDestroyGroupHeader
orafterRebuildGroupHeader
could solve the rest problems. So the way with destroying and rebuilding of the grid headers would be enough.Best regards
Oleg
P.S. My congratulation with the release of jqGrid 4.2.0!