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

Frozen columns limitations #430

Open
emeaaa opened this issue Apr 5, 2018 · 6 comments
Open

Frozen columns limitations #430

emeaaa opened this issue Apr 5, 2018 · 6 comments
Labels

Comments

@emeaaa
Copy link

emeaaa commented Apr 5, 2018

Hi Oleg,

I'm trying to freeze some columns in my grid following these instructions
http://www.trirand.com/jqgridwiki/doku.php?id=wiki:frozencolumns

but there are the following limitations:

  • When TreeGrid is enabled
  • When SubGrid is enabled
  • When cellEdit is enabled
  • When inline edit is used - the frozen columns can not be edit.
  • When sortable columns are enabled - grid parameter sortable is set to true or is function
  • When scroll is set to true or 1
  • When Data grouping is enabled
  • When footer row (footerrow paremeter) is enabled

Now I'd like to add these feature to a grid with inline edit( I'd like to only freeze non editable columns) and subgrids enabled.

Reading this answer http://www.trirand.com/blog/?page_id=393/bugs/frozen-column-impressions
and looking at the demo: http://www.ok-soft-gmbh.com/jqGrid/FrozenMultiselectColumns.htm

It looks like the inline edit is not a deal-breaker, is it possible to do something similar for the subgrid?

@OlegKi
Copy link
Member

OlegKi commented Apr 5, 2018

Could you describe your problem more exactly and provide your demo, which demonstrate your plans? I don't believe, that you want to use all above features in your grid. What exactly you need to do? The option scroll: 1 oder scroll: true I don't support at all. Any restrictions with inline or cell editing don't exist in free jqGrid.

Subgrid can be used in many ways: with local (previously loaded data), with data loaded via Ajax request, Grid as subgrid or as legacy subgrid (using subGridModel). Do you use paging in the grid? Has subgrid fixed height or you use "auto" height? ... It's difficult to write clean and safe code of frozen columns, which works in all possible cases. The main problem is adjusting the height of frozen rows after subgrid is filled. Frozen columns implementation some events, like jqGridResetFrozenHeights which allows to force ajusting of height of frozen elements. It allows to use frozen columns in some cases, which are not officially supported. You need just describe in details what you need and to create small demo, which probably not full work, but which demonstrates what you need to implement. Having the demo I could try to help you.

@OlegKi OlegKi added the question label Apr 5, 2018
@emeaaa
Copy link
Author

emeaaa commented Apr 6, 2018

Thanks for the answer,
I'm interested in freezing some columns in a grid with sorting, inline edit and subgrids enabled.
From my test I see that the sort and inline edit are working only for the unfreezed columns, but that should be fine.

But I was not able to get the frozen columns work while the grid has a subgrid.

Please see this fiddle http://jsfiddle.net/bozzoa/9zky1320/13/
Here I have two grids, one with subgrid and one without.
What I'm looking for is a way to have them both behave in the same way.

Thank you again!

@OlegKi
Copy link
Member

OlegKi commented Apr 6, 2018

Before writing any answer to you I want to clear which version of jqGrid you use (can use). You demo uses more as 4 years old jqGrid 4.6.0, which is not supported since many yeas. You use jQuery 1.9.1 published 2013-2-4 and jQuery UI 1.9.2 published 2012-11-23. Do you really need/want use the retro products?

You posted the issue to "free jqGrid" - which is the fork of jqGrid 4.7. The current version of free jqGrid is 4.15.4. You can load it from CDN (here or here). Here you will find some demos inclusive JSFiddle demos.

Additionally, you should never use addRowData in the loop to fill the grid. It's the worst and the slowest way to fill jqGrid. Instead of that one should fill an array (JavaScript object) with the data and to use the array as the value of data parameter. More then you use the same column names in both grids and you will both grids using the same ids 1,2,... The resulting HTML page contains many id duplicates.
To fix the problem you have to use idPrefix option in the grid (or at least in one grid) with different values. For example, idPrefix: "g1_" in the first grid and idPrefix: "g2_" in the second one. The page, which I already referenced before uses idPrefix too.

@emeaaa
Copy link
Author

emeaaa commented Apr 6, 2018

Thank you again,
I apologize, I made the fiddle in a hurry, forking an older one without checking the versions. I'm actually having the issue with my project using the latest version and I didn't notice the difference.
I see now that I can inline edit and sort the freezed column, thanks!

Here's an updated version with recent libraries and the fixes you suggested: http://jsfiddle.net/bozzoa/9zky1320/27/

I hope this fiddle is correct.

So I have one last question about the subgrids, is it possible to freeze some columns in a grid which contains a subgrid? using the same colModel for both grids in my fiddle, the top one is not getting freezed.

Thanks for your time.

@OlegKi
Copy link
Member

OlegKi commented Apr 9, 2018

It's too many implementation details, which should be took in consideration to use frozen columns with subgrids. It could be done by adjusting the code of subgrid module, but I'm busy not with other projects and can't do that now. I modified your demo to https://jsfiddle.net/OlegKi/9zky1320/75/ to shows you how one can use frozen column in the simplest case. Even the code required more additional synchronization in selections between selection of rows of frozen subgrid and selection of subgrid of non-frozen subgrid. One can prevent selection and hovering, but one will still have problems with inline editing (started by formatter: actions, for example). In any way, the problem with adding support of subgrids for frozen columns isn't easy to implement.

@lily2088
Copy link

demo https://jsfiddle.net/OlegKi/9zky1320/75/

open subGrid then click header1 sorting
It seems that there are a few more subGrid

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants