Wednesday, July 24, 2013

Going with the ExtJS Grid, and giving up on Dojo Data Grid

I was really excited about using the features of the Dojo data grid, especially after watching Brad Balassaitis's TLCC webinar.   I think that Dojo grid has a lot to offer, but I have concluded that it just does not work for me.  I spent a lot of time trying to work through several issues.   The issues I had with it are: 
  • Issue with writing edited columns back to server
  • Spent way too long trying to figure out how to disable column sorting - was successful here.
  • Spend way too long trying to disable allowing user to adjust column widths - was unsuccessful here
  • Issue with blank lines when using viewItemFileService REST service, this was the showstopper
  • General inflexibility
  • Not much out there on the web for help, even Stack Overflow could not come through for me.
When researching a fix for my dojo grid problems, I came across a series of blog posts by Marky Roden from earlier this year (that I somehow missed) on the use of ExtJS within Xpages.  I have to admit that I had never heard of ExtJS, and upon first glance, I actually thought it was Marky's lingo for external javascript libraries.  Upon reading further, I came to realize that this is a real product, and a really awesome product!   

ExtJS is a lot more than just a grid, just as Dojo is a lot more than just a data grid.  It includes a multitude of various controls.   One key point about ExtJS is that it is not free, it is $329 if you just buy the license. Before starting out, I explained all my Dojo grid troubles with my manager, and he gave me the go ahead with ExtJS.  

With the ExtJS grid, you don't have a visual designer whatsoever.  It is not integrated with Domino designer like Dojo.  You have to copy the files to your WebContent folder and reference them in your xpage.  The coding itself is all done in client side javascript, it is all just code, with no code completion either.   It really helped to layout the basic code structure on my whiteboard.   I would definitely say that the learning curve is definitely greater, but so is the flexibility.  It was really nice in that I was able to find answers quickly in google for questions I had.   It was not so easy with the Dojo data grid.  The online documentation is really good, and doubles as a demo of all you can do with the product.

This afternoon, I was able to get the grid to appear and talk to my REST service.  The great thing was that I used the very same REST service that gave me the blank rows in the dojo grid, and with the ExtJS grid it worked how I expected with no blank rows.  I might be blogging more about ExtJS as I get more into it, but I will never match the helpful info here in Mark Roden's blog series.  In addition to posting how to use ExtJS, Mark has included a sample database where you dig into the code.  If you find yourself struggling like me with the Dojo grid, then this might be worth a look.

6 comments:

  1. I struggled with the Dojo DataGrid a while back and I felt that it was way too heavy. When I switched with the Bootstrap framework, I created my own Bootstrap based Grid. We do everything as a REST services so it was easier to more to this direction.

    ReplyDelete
    Replies
    1. Richard, I would love to see a blog post on that if you ever get a chance.

      Delete
  2. I am looking forward to hearing all about your exploits :)

    Glad I was able to help.

    Let me know if you need anything @markyroden

    ReplyDelete
    Replies
    1. Thanks Marky, I will give an update post with how it ExtJS worked out for me. Thanks for all you do for the Notes community!

      Delete
  3. Glad you are liking ExtJS with Domino. If you need any help just give me a shout @jackratcliff

    ReplyDelete