jQWidgets Forums
Forum Replies Created
-
Author
-
April 28, 2014 at 11:07 am in reply to: Access aggregates in hidden grid Access aggregates in hidden grid #53666
Thanks, that is good to hear.
April 23, 2014 at 12:16 pm in reply to: Access aggregates in hidden grid Access aggregates in hidden grid #53485Awesome Dimitar. Using getAggregatedData is exactely what I needed. It allow me to get rid of the visibility:hidden tab workaround and revert back to the default display:none for tabs. I am absole to access the aggregates before the grid is displayed and before is called the ready function. Great! One question: Are there any unwanted side effects to calling
dataAdapter.dataBind();
before the grid is displayed and then using the same dataAdapter instance for the grid when it is displayed later? Everything appears to work just fine, but I though I’d ask about things to watch out for with this early call to dataBind. Thanks again!April 15, 2014 at 1:37 pm in reply to: Access aggregates in hidden grid Access aggregates in hidden grid #53117Thanks Dimitar. Interesting – I will check this out.
April 15, 2014 at 9:57 am in reply to: Access aggregates in hidden grid Access aggregates in hidden grid #53100Hi Dimitar,
I guess it’s a feature request. I don’t see a technical reason why the grid cannoy make the aggregate calculations *before* being visible. The only thing I can think of it lazy-loading, eg we don’t want to use up CPU cycles for something we possibly never see. I’d be fine if I had to call a special method to trigger aggregate computation in a
display: none
grid. I just want a way to access that data before a grid is visible and without duplicating the code inside jqxgrid to calculate it.As for the
visibility: hidden
issue: This happens only because of my current workaround (which works ok, but is very ugly). Basically I overrided Bootstraps tab mechanism to usevisibility: hidden
instead ofdisplay: none
. Like this:.tab-content > .tab-pane, .pill-content > .pill-pane { display: block; visibility: hidden; position: absolute; width: 99%; } .tab-content > .active, .pill-content > .active { display: block; visibility: visible; position: absolute; width: 99%; }
This means that both hiden and visible tabs/grids are
display: block;
and thus the ready function is called for hidden grids and aggregates are available. Bootstrap now sets visibility to visible when a tab becomes active. Good. One Problem: Status bars never get hidden. So if I have 3 tabs with 3 grids then I will see 1 grid from the open tab (two grids will be hidden via visibility) and I will always see all 3 status bars.
It appears that jqxgrid usesvisibility: visible;
internally for the showstatusbar API function. It is set directly as element style so it overrides thevisibility: hidden;
of the container tab.
I had to create a second workaround for this which calls the showstatusbar function each time a tab is clicked so that two status bars are hidden and the right one is visible.April 14, 2014 at 5:11 pm in reply to: Access aggregates in hidden grid Access aggregates in hidden grid #53062As a workaround I tried to use
visibility: hidden
instead ofdisplay: none
. This works fine for letting the hidden grid reach a state where they call ready, but unfortunately there is a visual problem. The three grids use showstatusbar to show a bar at the bottom with the aggregates. Every grids bar is displayed on every other grid, so the longer grids with have the shorter grid status bar displaying somewhere in the middle between two rows.April 14, 2014 at 1:52 pm in reply to: Access aggregates in hidden grid Access aggregates in hidden grid #53055Hi Dimitar,
Thank you for taking the time to respond. You are absolutely correct. Once the ready function is called the aggregates are available. I guess I am looking for a way to programmatically force a
display: none
grid to calculate the aggregates. I tried calling render, renderaggregates and refreshaggregates, but they don’t trigger anything.Any other ideas how to get aggregates of a hidden grid? If it really is impossible I’d like to put in a feature request for a function that allows to calculate aggregate when when a grid is not displayed. The grid already has all the data, so it should be able to make the calculations.
-
AuthorPosts