tag:blogger.com,1999:blog-5544768027628635238.post101065045390289050..comments2014-10-24T12:40:36.833+11:00Comments on Michelle's Universe: Implementing the jQuery DataTables plugin in a 'classic' Domino Web application.Michellehttp://www.blogger.com/profile/05167396174428055475noreply@blogger.comBlogger8125tag:blogger.com,1999:blog-5544768027628635238.post-88686627799787299122014-10-24T08:37:03.091+11:002014-10-24T08:37:03.091+11:00Michelle, this was just the article i needed to ge...Michelle, this was just the article i needed to get started with integrating a better solution to the old clunky Domino web pages we are all accustom to working on for many many years. I as well as of 6 months ago had no xPages experience, JSON objects, Dojo grids, Datatables, etc so after several months learning some xPages, REST services, xAgents, DataTables, a touch of JAVA and of course this great read to get me started here is what I actually did..<br /><br />At first (months ago) I implemented DataTables producing a JSON object using Lotusscript with a great LotusScript class i found from a gentleman by the name of Troy Reimer. This worked good except could not handle any data sets larger than a couple thousand docs if that and with any server latency issues you may have forget it cut that number in half. I think it took me over 30 seconds to load 4000 docs which is clearly unacceptable so what i did was just load the first 1000 set the datatables per page attribute to 100 docs and allow my users to next page..previous page etc. The filtering provided by Datatables is awesome i love the real-time search capabilities which prevented users having to next/previous page.. Worked wonderful! Sounds great, right! Well, i have 15,000 docs in a view so of course i needed to add a search functionality using FTSearch, etc build the JSON object and serve it back into DataTables etc. UGH i thought. There has got to be a better solution for this.<br /><br />So after several more months of learning and researching here is what i am doing today.<br /><br />What i do now is on web open I call an xPage. Ye, an xPage. Create a simple javascript var with a lookup to a profiledocument and in the onLoad event and in your Datatables $(document).ready(function() call that var something like this "sAjaxSource": CallGetJSON looks like this when i pull from my profile doc.."https://domdevostx01.ten-net.net/SASE/SASENomination.nsf/GetJSON.xsp".. GetJSON is the name of the xPage essentially an xAgent if you read up on that and in the afterRenderResponse event I call a Java Class that i modified(creation compliments to Jeff Byrd - Titled "Roll your Own Domino REST Service") that actually produces the JSON object and sends it back to me to be consumed.<br /><br />Oddly enough I STILL load my data into Datatables and not xPages. I am was not happy about the out of the box xPages view and Dojo grid and our organization will not fund the Dojo grid EXTJS - 600 dollars a license so I stick with Datatables which is awesome. I now can load 20,000+ documents in 5 seconds with all the nice filtering, paging, CSS modifications, etc that Datatables provides.<br /><br />Not to mention no more LotusScript to write out my JSON objects! Very nice, clean and fast.<br /><br />Thanks to you Michelle I thought I would share my story you got me started in the right direction and inspired me to go even further! <br /><br />Ohh the power of Domino who says it's going away!Aron Reynoldsnoreply@blogger.comtag:blogger.com,1999:blog-5544768027628635238.post-30607045144586613452013-01-03T11:39:50.522+11:002013-01-03T11:39:50.522+11:00Hi Ashwin
This plug-in does not really handle res...Hi Ashwin<br /><br />This plug-in does not really handle response documents in the way that a Notes view does - it has no concept of expand / collapse or parent / child etc. It renders a standard table only.<br /><br />But if your response documents make sense in a flat list, then your agent can return them & have them listed along with the parents.<br /><br />The plug-in also provides for a callback function to post-process each row after rendering, so you could add some additional HTML manipulation in a custom function if you wanted to, to change the appearance of the child rows or whatever made sense in the relevant context. Michellehttps://www.blogger.com/profile/05167396174428055475noreply@blogger.comtag:blogger.com,1999:blog-5544768027628635238.post-15296949121273540032013-01-02T23:06:20.380+11:002013-01-02T23:06:20.380+11:00Hi Michelle,
Can we include response documents as...Hi Michelle,<br /><br />Can we include response documents as well with this plugin?<br /><br />Regards,<br />AshwinAshwinnoreply@blogger.comtag:blogger.com,1999:blog-5544768027628635238.post-58907196127469426752012-06-22T23:50:11.349+10:002012-06-22T23:50:11.349+10:00@Alan. I'm sure you're right, and as Mich...@Alan. I'm sure you're right, and as Michelle indicated, maybe we aren't handling handlers most efficiently. Great feedback...thanks.nick wallhttps://www.blogger.com/profile/06758689291251855908noreply@blogger.comtag:blogger.com,1999:blog-5544768027628635238.post-70450535488350406402012-06-22T21:46:20.179+10:002012-06-22T21:46:20.179+10:00Nick - I have also used the Dojo framework (enhanc...Nick - I have also used the Dojo framework (enhanced grid) and actually can load large data set, 1000+, reasonably. Unlike Michelle, don't have to worry about IE6 specifically, but can attest to decent performance with more than 200 records using a dojo grid. That being said, I do agree about the search results paradigm.Alan Hurtnoreply@blogger.comtag:blogger.com,1999:blog-5544768027628635238.post-32986836438804301402012-06-22T18:39:46.616+10:002012-06-22T18:39:46.616+10:00Nick - I haven't done ant detailed testing, bu...Nick - I haven't done ant detailed testing, but with IE6 using jQuery, the problems seem to occur around the 1500-2000 records mark. There is also a deferred render setting which boosts this significantly.<br /><br />I have also found that how you handle any events (eg on click handlers) is significant. I generally attach a single handler to the entire table and process the current target, rather than registering handlers at the td or even lower.<br /><br />As for why users would want this number of results, I agree - if you are looking for a specific document, this number of results is pointless. If you want the data for reporting purposes, a dedicated export button can open the data as cvs, print to a plain table, email it to the user or some other, more useable solution.Michellehttps://www.blogger.com/profile/05167396174428055475noreply@blogger.comtag:blogger.com,1999:blog-5544768027628635238.post-48812528723972755182012-06-22T18:05:00.105+10:002012-06-22T18:05:00.105+10:00The project I'm on, we are using the Dojo fram...The project I'm on, we are using the Dojo framework, and we use dojo grids. I am interested to hear how you deal with large data sets. With dojo grids (we also have double click, right click and a bunch of other stuff going on), once we get to the 200 row mark, rendering client side becomes too high, we do use the "lazy" rendering (there's a whole series of issues with dojo grid rendering perf...sigh). We are trying to get rid of "traditional" concept of views and large search result sets, as we think scrolling though a view\ search with hundreds of docs doesn't make sense. If you are looking for something and you get back more than 200 results, then our point is, your search was not precise enough.<br /><br />In hindsight, if we could start project again, I think we may have chosen jQuery for this project.nick wallhttps://www.blogger.com/profile/06758689291251855908noreply@blogger.comtag:blogger.com,1999:blog-5544768027628635238.post-8944768025527320892012-06-22T02:27:56.517+10:002012-06-22T02:27:56.517+10:00Good read. I've used jqGrid in classic Domino,...Good read. I've used jqGrid in classic Domino, but not Datatables. I would say its a viable argument that these jQuery grid plugins actually offer more functionality than the basic Dojo grid does in XPages. (XPages does not use the Dojo enhanced grid)Alan Hurtnoreply@blogger.com