PDA

View Full Version : ext.ux.activegrid.ActiveGrid



gslender
7 Dec 2008, 2:37 PM
Folks,

Attached below is ActiveGrid (aka LiveGrid) and associated demo files.

ActiveGrid is specialized grid that displays a view that is backed by an active buffer. The supplied ListStore configured with a PagingLoader is used as the active buffer. The grid manages loading and paging as needed based on the scrolling of the view and its index. ActiveGrid will also prefetch data as needed as a background task so that user scrolling can continue with minimal interruption.

There is limitted docs and it is still very beta code - so please test and report back any issues/bugs etc.

Online demo here... http://www.rednels.com/ActiveGridTest/

ajaxvador
7 Dec 2008, 5:20 PM
very nice

leonate
7 Dec 2008, 10:36 PM
Thanks for sharing!

By the way I use FF 3.0.4 and IE7 and in both browsers the grid scrollbar is not visible for me. Is it a known issue?

--
Leonid

gslender
7 Dec 2008, 11:11 PM
Nope. I've tested in FF 3.0.4 and IE7 and in both browsers it all works fine.

Are you saying the demo site doesn't work, or just when its used in your code? :-?

If its your code, can you post an example that demonstrates this bug (ie make up a demo that shows this problem).

Cheers,
Grant

maku
8 Dec 2008, 12:27 AM
Grant,

really nice work :-)

leonate
8 Dec 2008, 1:06 AM
Nope. I've tested in FF 3.0.4 and IE7 and in both browsers it all works fine.

Are you saying the demo site doesn't work, or just when its used in your code? :-?

...

I tested the demo at my office computer and it all worked fine. So probably there is some issue with my home computer configuration.
--
Thanks,
Leonid

Kango_V
8 Dec 2008, 7:50 AM
I need to upload this to our Maven2 repo. What version would you say this is?

(1.0-alpha1 maybe?)

cravemusic
8 Dec 2008, 9:22 AM
It's great to see the rapidity at which this was developed. I applaud your fantastic work.

What are your plans for licensing this ActiveGrid?

gslender
8 Dec 2008, 1:14 PM
What version would you say this is? (1.0-alpha1 maybe?)

No, I'd prefer 1.0-beta1

gslender
8 Dec 2008, 1:15 PM
What are your plans for licensing this ActiveGrid?

It's licensed GPLv3

Kango_V
12 Dec 2008, 7:04 AM
Righto, i'll get that uploaded to our repo now. :)
I'm still on a learning curve with GXT, so this should be fun.

Again, really good job mate. One of our users wants to buy you a beer :D

Kango_V
12 Dec 2008, 7:06 AM
Just one more thing: If you used this with check boxes, would the gris cache those that are checked, ready for a "Save" action or would you recommend catching the event and updating the row on the server straight away?

gslender
12 Dec 2008, 1:36 PM
Kango_V,

The CheckBoxSelectionModel plugin (checked etc) would need to be modified to support the remembering of checked state similar to the ActiveGridSelectionModel.

You could either keep a local index backed hash of checked rows or send them back to the server as you suggest (the server side would be slow though).

It wouldn't take me long (nor is it that hard) to create an ActiveCheckBoxSelectionModel.

I'm available for a fee if you wish :D:D

Kango_V
13 Dec 2008, 1:03 PM
Yeah, that's what I thought. We may have a use case for this when our app has gone live.
I'm building a Production Services system to track fims, expenses, agreements, jobs, events, contracts etc etc etc.

It's getting bigger by the day. Also I've got to implement expenses into peoplesoft, contacts into Salesforce and invoices into Mapics/XA COM so the checkboxes could be useful. They keep us busy :))

Hehe, I'm still trying to get my boss to pay for an ExtGWT license. 8-|

Out of interest, what OS/IDE do you use to develop this stuff?

gslender
13 Dec 2008, 1:06 PM
Out of interest, what OS/IDE do you use to develop this stuff?

Windows XP and Eclipse 3.4 - but any OS/IDE would have worked as nothing about the OS or IDE was helpful in doing this work.

Kango_V
13 Dec 2008, 1:17 PM
Hehe, yep. I use Ubuntu and Eclipse 3.4 here. I'm just being the nosy bugger that I am LOL.

kht
3 Jan 2009, 4:08 PM
hi grant!

this is really a great work!
could this become part of gxt itself? would be great :D.

maybe i am using it wrong, but i tried with a datasource which has 0 or 1 entry. this made it end up in an endless loop inside updateRows...


if (realStore.getCount() < realStorePageSize) {
refresh();
return;
}refresh is always called and reloads... storeDataChanged(StoreEvent<M> se) is called after reload is finished and calls updateRows.... which itself calls refresh....

am i doing something wrong or is it a bug with smaller datasets?
anyhow: thanks for your great work!

regards, kht

gslender
3 Jan 2009, 7:55 PM
this is really a great work!
could this become part of gxt itself? would be great :D.


Thanks - I did this to see even if it was indeed possible to extend GXT Grid ...and it was ;-)

An official GXT Active/Live Grid is being targetted for after 2.0 - so it is unknown if this ActiveGrid will be taken up. There are better ways to do what I have done so I'm fairly sure it won't be, but its a start :)



maybe i am using it wrong, but i tried with a datasource which has 0 or 1 entry. this made it end up in an endless loop inside updateRows...


Ahh, yes this is expected. I never did consider someone using an active grid with no rows.



am i doing something wrong or is it a bug with smaller datasets?


This is a bug. In fact it probably doesn't work very well at all with a small number (or zero) rows.

Feel free to have a tinker with the code - it shouldn't be too hard to fix the bug and get it working with large and small rows.

les
26 Jan 2009, 1:27 PM
Hi Grant,

Any updates on ActiveGrid?

Are you planning on completing this? Or, is the plan to wait for a post 2.0+ version in GXT?

Thanks for all your work and effort on this widget, it is really important, IMO.

gslender
26 Jan 2009, 5:37 PM
I'll happily add patches or fixes - but as a live grid equiv will be added eventually, there is no real point in me spending massive amounts of hours on it.

Cheers,
Grant

Adam Ward
17 Feb 2009, 2:01 PM
Hi Grant,

Again, really great work here. Ok, on to the issue at hand, I'm attempting to call reconfigure on the ActiveGrid and supplying it with a new ListStore and ColumnModel (essentially I want to show data from a different table in my DB). This doesn't work right out of the box, and was hoping you might have some suggestions on where some of the pain points may lie... I realize that you are no longer developing this widget, but any guidance or suggestions that you can provide would be much appreciated!

Cheers!
Adam

Adam Ward
17 Feb 2009, 2:15 PM
Another tid bit of info to add to my last post is that it appears that the load method on the BasePagingLoader is never getting called during the reconfigure() process.

gslender
17 Feb 2009, 2:17 PM
yep - best to produce a test case showing issues - that way I can easily compare and fix it.

I hate having to think up a test case to reproduce something... that sux and I'm lazy ;-)

paco_online
2 Mar 2009, 3:09 AM
hi gslender,

very good work (saw the ActiveGrid working in the online demo).

but for me it's not working, because it seems, that the Constructor for com.extjs.gxt.ui.client.event.SelectionEvent changed and so the code for ext.ux.activegrid.client.ActiveGridSelectionModel is not working any more for the line fireEvent(Events.SelectionChange, new SelectionEvent(this, new ArrayList(selected)));

is there an update for the ActiveGrid or can you say what time this feature goes to the Ext GWT standard?

greetings
paco

edit: i imported your testproject (Test.gwt.xml) into my eclipse (with the older version of gxt 1.2.1 - so the error described above not occured). but it seems that the service call is repeatingly called and never stops. so the items where never shown.

Adam Ward
4 Mar 2009, 3:39 PM
Paco,

I had the same problem. You can work around this by adding the following class to your src tree (make sure you create the exact package that is included at the top of this file). Essentially it is the SelectionEvent class from gxt 1.1.3, which to my knowledge, is the version that the ActiveGrid was written against, and it includes an additional constructor. I do not know why the GXT team removed the constructor, but the ActiveGrid seems to work when I include the older version of the file.



/*
* Ext GWT - Ext for GWT
* Copyright(c) 2007, 2008, Ext JS, LLC.
* [email protected]
*
* http://extjs.com/license
*/
package com.extjs.gxt.ui.client.event;

import java.util.List;

import com.extjs.gxt.ui.client.data.ModelData;

/**
* Selection event type.
*
* @param <M> the model data type
*/
public class SelectionEvent<M extends ModelData> extends BaseEvent {

/**
* The selection.
*/
public List<M> selection;

/**
* The model.
*/
public M model;

/**
* The index.
*/
public int index;

public SelectionEvent(Object source, List<M> selection) {
super(source);
this.selection = selection;
}

public SelectionEvent(Object source, M model) {
super(source);
this.model = model;
}

}



Again, just create a package "com.extjs.gx.ui.client.event" in your source tree, drop that source into the new package, and the Java compiler will pick up your version of SelectionEvent instead of the one included in the gxt jar.

paco_online
4 Mar 2009, 11:34 PM
hi,

thx for this suggestion. if i do, what you say, all the compiler errors are resolved and i can run the sample with the version 1.2.3 oif EXT GWT.

After fixing an error in the HugeData.java in the line setDate(new Date(s[2])); in the Constructor ;) Just setting it to setDate(new Date());. This should also work for the Example "Test.java".

Now the service is loading the data and it seems, also returning them. The Grid comes from the mask() state to the unmask() state. But no data where shown in the Grid :(

What's wrong with my code? I run the example in Eclipse 3.4.1.

greetings
paco

@edit:
i tried the version 1.1.4 from GXT (with 1.1.3 there are some errors - some Events constants where not found). And what can i say - it's working with 1.1.4 - the data is now shown in the grid. So can anyone tell my what changed, that with the current version of GXT it's not working?

@edit2:
After some more testing i found out, that it's working to version 1.2.2 (inclusive). From version 1.2.3, the data where not shown in the grid after loading from service.

Adam Ward
5 Mar 2009, 11:58 AM
I have confirmed Paco's findings. 1.2.2 seemed to be good.

paco_online
6 Mar 2009, 3:23 AM
Hi all,

after some debugging and testing i found out, what makes the ActiveGrid not working with GXT 1.2.3.

It is the ListStore in the method public void remove(M model) at Line 292. The line modified.remove(getRecord(model)); does not work with GXT 1.2.3. If you change the line to the version of GXT 1.2.2 modified.remove(model); it's working!

Yet i have no idea why it's so (i have to digg into more), but with this code change it's working. Maybe someone, who is more familiar with the GXT code can say more.

Greetings Paco


edit:
some more testing - i found out the error.

the line modified.remove(getRecord(model)); is calling the getRecord(M model) from the Store Class. Ths wraps the model to a Record. But if the model is null, the method throws a java.lang.RuntimeException: Record cannot wrap a null model Exception which is handelt in the onSuccess(...) method of the RpcProxy. But i never saw this Exception in a StackTrace or so ... maybe my fault.

Adding the following lines to the ListStore Class in the method public void remove(M model) at Line 292 are helping to prevent wrapping a null Object.


if (model != null) {
modified.remove(getRecord(model));
}

gslender
6 Mar 2009, 12:57 PM
paco_online - you are correct but also wrong...

the bug is in ListStore, but the solution is not what you've shown.

the lines

modified.remove(getRecord(model));
if (isFiltered()) {
snapshot.remove(model);
}
needs to be up before the lines

unregisterModel(model);
in the if/then case

the unregister was removing the model before it was removed from modified

this has been fixed in SVN

paco_online
9 Mar 2009, 7:30 AM
somebody know what the SVN url is?

chrismcnally
10 Apr 2009, 12:16 PM
Grant,

I just checked out

svn co http://code.extjs.com/svn/gxt/trunk

I do not see ActiveGrid in there. Is there another svn url I should use?

gslender
12 Apr 2009, 5:17 PM
The ActiveGrid licensed for GXT commercial customers is located here >>> http://code.extjs.com/svn/gxt/work/

paco_online
13 Apr 2009, 12:35 AM
But still not working with a small number (or zero) rows :s

DaBlick
23 Apr 2009, 10:49 AM
What happens in Livegrid when a sort order (column or direction) is selected?

borillo
27 Apr 2009, 5:00 AM
The ActiveGrid licensed for GXT commercial customers is located here >>> http://code.extjs.com/svn/gxt/work/


Hi,

Is ActiveGrid download available for non commercial customers? If so, Where?

Best regards,
Ricardo

sven
27 Apr 2009, 5:02 AM
Have you read the thread? It is linked here.

borillo
27 Apr 2009, 5:08 AM
Have you read the thread? It is linked here.

Hi sven,

Is read the full thread and i see the demo site and the source code attached, but next in the thread, i see that there were some updates after this version.

I think that the last version of ActiveGrid is located on http://code.extjs.com/svn/gxt/work/, but i have no access to that resource ...

Perhaps i'm missing somethin :(

Best regards,
Ricardo

sven
27 Apr 2009, 5:10 AM
The latest version that is avaible in public is linked in that thread. If you need access to the one located in SVN, than feel free to buy a support subscription:

http://www.extjs.com/store/gxt/#support-table

paco_online
27 Apr 2009, 5:20 AM
but the version (in SVN) is still not working with a small number (or zero) rows as i wrote in my previous post.

if you try this version with the example test case "Test.java" (download for public) and you add only (for example about 5) rows, the service repeats calling.

i'm waiting for the fix, for a long time (:|

sven
27 Apr 2009, 5:22 AM
Fell free to fix it and give the fix to the author of this extension. I think he will add it than.

paco_online
27 Apr 2009, 5:29 AM
hi,

i do not have the GXT and java know-how to fix this bug.

sorry - for this i bought the support subscription. not every person, using GXT is such a good programmer to fix a bug in GXT. some developers are "only" user.

sven
27 Apr 2009, 5:30 AM
It is not a bug in GXT. The activegrid is not part of the official GXT library.

paco_online
27 Apr 2009, 5:39 AM
ok - that's right.
activegrid is not a part of GXT. but i hope it will become part of it (fixed ;)) - or something like ActiveGrid. for this, i'm waiting for a long time.

so your answere "yust fix it" made me, let me say, a little bit angry :">

you see a good change for a feature like AktiveGrid in the new GXT 2.x? I think, i'm not the only one, requesting this.

sven
27 Apr 2009, 5:42 AM
I see a good chance ;) I guess more infos will follow :P

Kango_V
28 May 2009, 3:26 PM
Does the current ActiveGrid work with 2.0 M2?

Kuljeet S Kohli
1 Jun 2009, 7:51 AM
I just downloaded ActiveGrid.zip but winzip is not able to unzip it. The unzip command also displays the error - 'End-of-central-directory signature not found'.

Can someone please post your copy that unzips fine?

Thanks
Kuljeet

luisve
4 Jun 2009, 4:14 AM
Are there any plans to officially release ActiveGrid?

paco_online
4 Jun 2009, 4:18 AM
i thought that the BufferedGrid in 2.0 IS LIKE THE ActiveGrid :-?

please correct me, if i understood something wrong

luisve
4 Jun 2009, 6:12 AM
Maybe i didn't fully understand the ActiveGrid, but i'm looking for a scrolling grid that retrieves data from database when it's scrolled, like smartgwt Livegrid

jpnet
4 Jun 2009, 6:33 AM
i thought that the BufferedGrid in 2.0 IS LIKE THE ActiveGrid :-?

please correct me, if i understood something wrong


AFAIK, BufferedGrid has all of the data in memory, just not completely rendered. Where as ActiveGrid/LiveGrid actually performs ajax requests AND renders when scrolling.

-JP

paco_online
4 Jun 2009, 7:22 AM
ok - that's right
i forgotten this difference :">

Maybe you can use a different Proxy (RpcProxy) to do server-side reloads?

aseem_jain
19 Jun 2009, 12:53 AM
hi,

I have downloaded ActiveGrid example and facing problem to run it on GXT 1.2.4

[ERROR] Errors in 'jar:file:/D:/ext-Gwt/gxt-1.2.4/gxt.jar!/com/extjs/gxt/ui/client/widget/selection/AbstractStoreSelectionModel.java'
[ERROR] Line 266: The constructor SelectionEvent(AbstractStoreSelectionModel<M>, M) is undefined

Can anybody help

Regards,
Aseem

aseem_jain
21 Jul 2009, 5:58 AM
Hi

I have ported the activegrid code in gxt 2.0 with gwt 1.6.

Initially i am using only 2 files from the jar; activeGrid and activeGridview without toolbar etc. I am able to get the grid window and column titles initially but without data. Later on the grid data is requested in infinite loop, response reaches but the data is not shown/rendered in the grid.

pointers and help would be appriciated . . .

:) Aseem Jain

takayser
27 Jul 2009, 1:00 AM
there is an LiveGrid planned from Ext GWT for 2.1 (roadmap (http://extjs.com/products/gxt/roadmap.php)), you may want to await for that?

aseem_jain
27 Jul 2009, 5:45 AM
:)

I was able to run this active grid on gxt2.0, what all i was missing is the CSS link for scroll bar due to which i was going in infinite loops.

regards,
Aseem Jain

erincarikan
4 Aug 2009, 12:33 PM
For some reason I can't download the zip file and extract it properly. When I try to extract it can not find anything to extract. I tried it 10 times at least.

Is it possible to send this file to me?

It would be a huge favor.

lmivan
30 Aug 2009, 2:38 PM
Hi

I have ported the activegrid code in gxt 2.0 with gwt 1.6.

Initially i am using only 2 files from the jar; activeGrid and activeGridview without toolbar etc. I am able to get the grid window and column titles initially but without data. Later on the grid data is requested in infinite loop, response reaches but the data is not shown/rendered in the grid.

pointers and help would be appriciated . . .

:) Aseem Jain

Please, could you post the ported active grid code?.

Thanks a lot, Iván.

mattpainter
13 Oct 2009, 8:43 PM
Hi,

Firstly, thank you so much for writing ActiveGrid. I have downloaded the alpha code, fixed up a few compilation errors to get it to work with GXT 2.0.1 and all is dandy.

However, there are odd refresh issues that present themselves when I scroll vertically once I have scrolled horizontally (I have many columns), which I'm wondering if you've seen before or if you have any advice.

My configuration is this:


One large border layout
Central panel contains ActiveGrid
Left panel contains operations (currently empty)
ActiveGrid contains 31 (!) columns, with column groupings
Buffer size of 200, with 20% pre-fetch
Data set of ~30,000 rows

When I scroll through the grid with the horizontal position at the default far left, all is well. However when I move to the far right, the entire viewport briefly flashes. Additionally, the horizontal scrollbar often shifts back to the left hand side.

Starting from the top and scrolling down row by row with horizontal scrolling at far right, I get to around four or five rows before the horizontal scrollbar jumps left again. Playing around with this a bit further, and the grid started rapidly scrolling left and right. Now Firefox is at 99% CPU and very unhappy indeed.

Any ideas? I'm a rank amateur with GXT so am not sure where to start.

FWIW, I was previously using Ext JS with the LiveGrid module and the same size dataset, and have never experienced problems of this nature.

This table - and the data manipulation operations I am going to build around it - is key functionality for a major one-year project, so I am very keen to get this working well. I recently stopped developing this using Ext JS and started migrating to GXT because of maintainability / debugging / unit testing concerns, however if I can't resolve this I will be forced to drag out the Ext JS code again :/

Whereas I'm a GXT newbie, I'm an experienced Java developer so am more than happy to assist with work around ActiveGrid if required.

Thanks,
Matt

valery.stroeder
27 Jan 2010, 2:55 AM
Hello,

The on-line demo link isn't available.
What are the steps to integrate your ActiveGrid?

only put the jar in my library directory ?

mattpainter
27 Jan 2010, 12:16 PM
Hi Valery,

GXT 2.1 now has Live Grid functionality so the Active Grid plugin is no longer required. I am using the Live Grid and can confirm that it works well.

See http://www.extjs.com/examples/explorer.html for the demo.

M

valery.stroeder
28 Jan 2010, 1:19 AM
Hi MattPainter,

Thank you for your answer.
Another question : is a there a way to get a gxt class diagram ?
It would be useful to print it.

Valery

nhantao20
19 Mar 2014, 1:30 AM
My God .. Thanks A Lot I love This Plugin... many thanks.ext.ux.activegrid.ActiveGrid is the best.