PDA

View Full Version : categorized views



codepig
24 May 2007, 8:16 AM
hi all,

i am a domino developer with a few years worth of notes-related javascript in my pocket. a while ago, i created an ajax-based notesview script that works with any view: categorized (any levels), response hierarchy, flat, folders, etc.
it's a little rough around the edges but i posted it on openntf just to see if anyone could actually use it(http://www.openntf.org/projects/codebin/codebin.nsf/CodeByDate/B588214FD8B22C63862572D8006A24C9).

i notice the Ext.ND has trouble with categorized views, perhaps my code could help, perhaps not :-?

have a look anyways,

galdaka
24 May 2007, 8:50 AM
Any link for testing or image for view the results?

Thanks in advance,

codepig
24 May 2007, 9:09 AM
I just uploaded a quick sample image to the openntf page:
http://www.openntf.org/projects/codebin/codebin.nsf/CodeByDate/B588214FD8B22C63862572D8006A24C9/$file/viewsample.JPG

For testing, you'll have to download the demo database and run it on your own server.

RWaters
24 May 2007, 9:11 AM
Hmm, very interesting. I like the agent you wrote that returns readviewentries style search results.

The display is a little odd feeling with the page down buttons on the right hand side, but I like a lot of what you have done.

codepig
24 May 2007, 9:21 AM
ya, i'd like to add a more proper scrollbar-looking navigation thing on the right-hand side. i just never got that far, and then other projects called me away. it also needs column resizing, which i'm currently fiddling with when i find time.

mdm-adph
25 May 2007, 7:59 AM
hey -- I was just playing with your .nsf that I downloaded from openntf.org just the other day. It's similar to something I've made in-shop for views in my Notes applications, though your OO-javascript puts my mashed-together mess to shame. :D

about the categorization/grid problem in Ext -- is there any support for some kind of "colspan"-equivalent property in the grid object (like in HTML tables)?

jratcliff
25 May 2007, 11:59 AM
I don't think there is current support for colspan in the Ext grids. My guess is that we'll have to override some of the grid rendering code and do this ourselves.

codepig
25 May 2007, 2:19 PM
FYI, i now have a project on OpenNTF for my view code and I hope to maintain and upgrade the code there with community feedback

http://www.openntf.org/Projects/pmt.nsf/ProjectLookup/NotesView2

GavinL
18 Jun 2007, 1:30 AM
I don't think there is current support for colspan in the Ext grids. My guess is that we'll have to override some of the grid rendering code and do this ourselves.

I thought I'd have a go at extending the Ext 1.1 beta 1 code (See images below - sorry, no demo as I've no way of hosting it). Parent/Response views and Categorised views are functional (at least, the ones I've tried it against), along with views that display multi-value fields from response documents. It still needs some work with regards to categorised views with total columns, and I haven't looked at single category views yet.

Response rows are loaded into the store on demand as categories / parent rows are expanded. After the initial load the nodes in the DOM are simply hidden/shown depending on the state of the twistie.

Jack R / Rich W - I'd be happy to donate the code to the Ext.ND project if it's of interest to you. Unfortunately it doesn't use Ext.ND as the base at the moment as it's built on top of my custom classes, so if I get some time over the next couple of weeks (no promises there) I may have a look at integrating it. However, It may be best to wait until you release the next beta, as the underlying code base may have changed significantly.

724725

galdaka
18 Jun 2007, 2:05 AM
Ho ho ho.

Very interesting...

Any link for test?

RWaters
19 Jun 2007, 6:21 AM
I thought I'd have a go at extending the Ext 1.1 beta 1 code (See images below - sorry, no demo as I've no way of hosting it). Parent/Response views and Categorised views are functional (at least, the ones I've tried it against), along with views that display multi-value fields from response documents. It still needs some work with regards to categorised views with total columns, and I haven't looked at single category views yet.

Response rows are loaded into the store on demand as categories / parent rows are expanded. After the initial load the nodes in the DOM are simply hidden/shown depending on the state of the twistie.

Jack R / Rich W - I'd be happy to donate the code to the Ext.ND project if it's of interest to you. Unfortunately it doesn't use Ext.ND as the base at the moment as it's built on top of my custom classes, so if I get some time over the next couple of weeks (no promises there) I may have a look at integrating it. However, It may be best to wait until you release the next beta, as the underlying code base may have changed significantly.

724725


Looks great, I'd love to take a look!

eknori
19 Jun 2007, 7:19 AM
wow, impressive!!

GavinL
19 Jun 2007, 7:39 AM
Thanks - give me a couple of days to clean up the code a little, and I'll post a copy to the OpenNTF code bin.

galdaka
19 Jun 2007, 7:57 AM
Thanks - give me a couple of days to clean up the code a little, and I'll post a copy to the OpenNTF code bin.

Thanks in advance , I can

becomcs
19 Jun 2007, 1:35 PM
[QUOTE=galdaka;40048]I can

jratcliff
19 Jun 2007, 5:35 PM
Jack R / Rich W - I'd be happy to donate the code to the Ext.ND project if it's of interest to you. Unfortunately it doesn't use Ext.ND as the base at the moment as it's built on top of my custom classes, so if I get some time over the next couple of weeks (no promises there) I may have a look at integrating it. However, It may be best to wait until you release the next beta, as the underlying code base may have changed significantly.


Of course we're interested in this code. What you've done looks great! =D>

By the way, how are you building the toolbar? We're adding support for domino actionbars in the next alpha and it would be nice to compare notes.

~JR

GavinL
20 Jun 2007, 12:52 AM
Of course we're interested in this code. What you've done looks great! =D>

By the way, how are you building the toolbar? We're adding support for domino actionbars in the next alpha and it would be nice to compare notes.

~JR

Thanks - you guys provided the inspiration to start this, so it's only right I contribute this code back. Several of the items, including the action bar, are based off code from some of your earlier postings here anyway.

The toolbar's being built in more or less the same way you're doing it (I think). I have an agent that exports the DXL for the views actions and shared actions, which then maps the shared action id's to the specific shared actions. It's still in the early stages, and the actions aren't functional at the moment (They just display an alert containing the code for the action). The major issue is that some of the actions use hide/when formulas to determine whether they are displayed or not, which means extracting the formula and then sending it back to the server asynchronously to evaluate - it's certainly feasible, but could result in many async calls back to the server depending on the number of actions.

The other problem I've run into is that sometimes the DXL returned is corrupt - for example, pointing my agent at the People view of the NAB results in a half mangled DXL document (at least with 7.0.2 FP2) - some stray characters in one of the actions causes the issue, and deleting the trailing spaces and resaving solves it. However, this isn't ideal as I've managed to crash the HTTP task several times because of this (Under 7.0.2 at least - 6.5.4 failed silently on the server). Do you see the same issue? It could be I just have an old NAB design - I need to investigate this further.

An alternate approach might be to create a $$ViewTemplate and attach an embedded view that computes its value from a parameter (view name) on the URL. This view would be set to to display the action bar as a Java applet. Using an async Ajax call, it would then be possible to retrieve the contents of the Applet tag - this contains the actions as parameters (including the url to their icons) and the page should also contain the JavaScript for the onClick events.

I'll bundle everything I have up into one template very soon - I've just added support for RestrictToCategory and handling documents with Readers fields, but want to try and fix Category views that contain total columns first. The approach I've taken is slightly different to that of Ext.nd in that no design elements need to be copied into the target database - you just create a config document in a central db that points to the target, then open the document in a browser.

GavinL
28 Jun 2007, 2:23 AM
I've added the code to the OpenNTF code bin - I can't promise it will work for every database, but I've had success using it against the categorised views in the address book and against a discussion database, plus a couple of other custom designs.

A word of warning - the Action Bar code uses an agent that exports the DXL for the view. Some of the views in the address book produce corrupt DXL (People view for instance), and after several view switches you may find you crash your server's HTTP task - I suggest leaving action bars disabled unless its a development system where you can easily restart it. The Action Bar's aren't actually functional, so you wont be missing much anyway.

Views with categories that contain hundreds of documents may not perform too well in this release. I need to implement a lazy loader so that response documents are loaded as the view is scrolled - however, that's quite a task and is not something that will happen any time soon.

Views with many subcategories that contain fewer documents per category will work best with this release.

Feel free to use any of this in the Ext.ND project if it's of use.

http://www.openntf.org/projects/codebin/codebin.nsf/CodeByDate/67BCFE4494F3639E862573080037FD81?OpenDocument

BTW - The code uses the ext-all-debug.js library - you might want to change this in the form to use ext-all.js

jratcliff
28 Jun 2007, 4:18 AM
I've added the code to the OpenNTF code bin - I can't promise it will work for every database, but I've had success using it against the categorised views in the address book and against a discussion database, plus a couple of other custom designs. Thanks! Can't wait to see what you've done!



A word of warning - the Action Bar code uses an agent that exports the DXL for the view. Some of the views in the address book produce corrupt DXL (People view for instance), and after several view switches you may find you crash your server's HTTP task - I suggest leaving action bars disabled unless its a development system where you can easily restart it. The Action Bar's aren't actually functional, so you wont be missing much anyway.
No problem. We've fixed the agent that Ext.nd.Actionbar calls. Turns out there's a bug with the NotesStream class. Jerry found and fixed this problem and we've tested it against a domino directory. http://www.openntf.org/extnd/names.nsf/main.html

Jerry has a blog post about the bug that you can read here > http://www.datatribesoftwerks.com/members/datatribe/DatatribeBlog.nsf/archive/20070626-0BA6E8?OpenDocument

Oh, and Rich figured out how to get and bind Javascript code defined for an action to a button on the Ext.Toolbar that we create for actions.



Views with categories that contain hundreds of documents may not perform too well in this release. I need to implement a lazy loader so that response documents are loaded as the view is scrolled - however, that's quite a task and is not something that will happen any time soon.Well, maybe with a few more developers looking at this it can happen sooner than you think. ;)

I've already started writing code for categorized views and so has Nathan (or I think it's someone who works with him at Lotus 911) but we put things on hold once we started seeing what Jack was doing with Grids in Ext 2.0. He's adding support for "grouping" which for us Domino developers is the same thing as categorized views. So some of the issues we may all be running into can be solved with Ext 2.0.

At any rate, my plan was to start with Ext 2.0 as the base code for categorized views and extend it as need to support Domino. Your contribution may allow us to add this support now without having to wait for Ext 2.0. I'm sure there will be quite a few domino developers that will be happy about that. :)



Views with many subcategories that contain fewer documents per category will work best with this release.

Feel free to use any of this in the Ext.ND project if it's of use.

http://www.openntf.org/projects/codebin/codebin.nsf/CodeByDate/67BCFE4494F3639E862573080037FD81?OpenDocument

Again, thanks for your contribution to the project!

GavinL
28 Jun 2007, 4:36 AM
Jerry has a blog post about the bug that you can read here > http://www.datatribesoftwerks.com/members/datatribe/DatatribeBlog.nsf/archive/20070626-0BA6E8?OpenDocument

Ah, yes - a better approach. I'll give that a try later.


Oh, and Rich figured out how to get and bind Javascript code defined for an action to a button on the Ext.Toolbar that we create for actions.

Did you manage to figure out how to handle actions that use hide/when formulas? Hide from web/notes is fairly trivial - hide/when formulas seem more of a challenge.


Well, maybe with a few more developers looking at this it can happen sooner than you think. ;)

That's what I hope :) - I'm sure you all will be able to progress this much faster than I could on my own.


Again, thanks for your contribution to the project!

You're welcome - and thank you for Ext.ND. Only too happy to contribute to this worthwhile project.

If you manage to get the example working (Sorry, my instructions aren't great, but post any issues and I'll try and see what the cause it), have a look at the column sorting code - it may be of use to you.

GavinL
28 Jun 2007, 11:00 PM
No problem. We've fixed the agent that Ext.nd.Actionbar calls. Turns out there's a bug with the NotesStream class. Jerry found and fixed this problem and we've tested it against a domino directory. http://www.openntf.org/extnd/names.nsf/main.html

Jerry has a blog post about the bug that you can read here > http://www.datatribesoftwerks.com/members/datatribe/DatatribeBlog.nsf/archive/20070626-0BA6E8?OpenDocument

That worked great - helped fix the issue in 2 minutes. I've uploaded a revision to the code bin: http://www.openntf.org/Projects/codebin/codebin.nsf/CodeByDate/67BCFE4494F3639E862573080037FD81?OpenDocument

I've also updated the action bars to retrieve the JavaScript / @Formula code.

Screenshot here: http://www.openntf.org/Projects/codebin/codebin.nsf/CodeByDate/67BCFE4494F3639E862573080037FD81/$file/screenshot.png

galdaka
29 Jun 2007, 3:17 AM
Hi,

@Ext.nd team: Can you put this code in to a public domain domino database? (Many people like view GavinL code live)

@GavinL: Your code is based on Ext.nd? Depends of Ext.nd?


Thanks in advance,

GavinL
29 Jun 2007, 3:54 AM
Hi Galdaka,

My code does not require Ext.ND to function - I've made the code available in order that the Ext.ND team can integrate any of it they find useful into their product.

RWaters
29 Jun 2007, 6:50 AM
Like Jack said above, we are looking at this code and GavinL has done a great job. I believe our intent is to take some concepts from this code and merge them into the Ext 2.0 grid that has grouping support built in.

Though, I have not yet had a chance to take a look into this code, if it looks simple enough perhaps we'll work it in until the actual release of Ext 2.0.

galdaka
29 Jun 2007, 7:00 AM
Sorry for my bad English,

I think that part of Ext community would be works in tree-grid widget. When this widget is created, the connection with all server-side plataforms will be easy and clear.

Thanks in advance,

galdaka
3 Jul 2007, 11:34 AM
Sorry for my English,

If Ext have a treeGrid that consume XML (or JSON data), how much it cost make ?ReadViewEntries XML adaptable to treeGrid?

Would you think that pseudo-solutions like http://www.openntf.org/Projects/codebin/codebin.nsf/CodeByDate/67BCFE4494F3639E862573080037FD81/$file/screenshot.png are interesting?

Why not we make treeGrid developent group?


Thanks in advance,

Zakaroonikov
3 Jul 2007, 2:09 PM
Sorry for my English,

If Ext have a treeGrid that consume XML (or JSON data), how much it cost make ?ReadViewEntries XML adaptable to treeGrid?

Would you think that pseudo-solutions like http://www.openntf.org/Projects/codebin/codebin.nsf/CodeByDate/67BCFE4494F3639E862573080037FD81/$file/screenshot.png are interesting?

Why not we make treeGrid developent group?


Thanks in advance,

I have been very successful making use of the classes supplied in the existing Ext.nd framework and applying them to other functions. The Ext.nd.UIView creates a datastore containing all of the necessary information for other Ext (not Ext.nd) classes to make use of like Ext.View, Ext.form.ComboBox. It converts all the readview entires for you.

I assume as long as the there is nothing special about the format of the data going into this treeGrid, the same will be able to be done with it as well.

GavinL
4 Jul 2007, 1:29 AM
I assume as long as the there is nothing special about the format of the data going into this treeGrid, the same will be able to be done with it as well.

There's nothing special - it grabs the design from ?ReadDesign and the data from ?ReadViewEntries. Take a look at dae/build/view/ViewRenderer.js (Shared Code\Script Libraries) in the dae.ntf template in the zip file here: http://www.openntf.org/Projects/codebin/codebin.nsf/CodeByDate/67BCFE4494F3639E862573080037FD81/$file/Templates.zip

When Jack R and Rich W release Beta 2, I'll have a look at adding the categorized view functionality direct to their classes rather than having to use my own custom classes. There are many similarities between the two code bases, so it shouldn't be too difficult to do.

dominodeviant
17 Jul 2007, 10:46 PM
Hi Rick,

I am new to this forum but I have been following the project since the DWT evolution.
I wonder if Ext.nd Alpha 2 release have some kind of support for categorized views (with or without looking into GalvinL:s solution) or are you waiting for the Ext 2.0 and the new grids?

I also have a question for GalvinL: Can I implement your solution with the new Ext.nd wihtout affecting any fuctionality in Ext.nd and only having the advantage of support for categorized views.

Thanks in advance for your amazing work.

//DD


Like Jack said above, we are looking at this code and GavinL has done a great job. I believe our intent is to take some concepts from this code and merge them into the Ext 2.0 grid that has grouping support built in.

Though, I have not yet had a chance to take a look into this code, if it looks simple enough perhaps we'll work it in until the actual release of Ext 2.0.

GavinL
18 Jul 2007, 1:12 AM
I also have a question for GalvinL: Can I implement your solution with the new Ext.nd wihtout affecting any fuctionality in Ext.nd and only having the advantage of support for categorized views.


Take a look here: http://extjs.com/forum/showthread.php?p=47270#post47270 :)

dominodeviant
18 Jul 2007, 2:28 AM
Take a look here: http://extjs.com/forum/showthread.php?p=47270#post47270 :)

hat off for you =D>
you are not only good but also faster then lightning :-?
I really appreciate your contribution, thanks thanks thank you again.

//DD

galdaka
18 Jul 2007, 2:58 AM
http://extjs.com/forum/showthread.php?t=9403

What about this solution for categorized views?

GavinL
18 Jul 2007, 4:22 AM
http://extjs.com/forum/showthread.php?t=9403

What about this solution for categorized views?
It looks to me that this is based on Ext 2.0 (See similarities to http://extjs.com/forum/showthread.php?t=6938). Therefore, it could be the base for a future solution, but isn't an immediate fit with Ext.nd which uses the Ext 1.x code base.

galdaka
1 Aug 2007, 1:21 PM
http://extjs.com/forum/showthread.php?t=10199

Example of one-level with Ext 2.0: http://qwikioffice.com/ExtJS-Demos/FormGrid/

captainm1uk
16 Oct 2007, 5:45 AM
Hi

I have had a look at this db and when I launch the app I get Ext is undefined

aden roper
16 Sep 2009, 12:43 AM
Hi Guys did any of this great code end up any of the EXT.ND releases.?

It looks good.