As a way to learn ExtJS, I decided to put together a sample web application whose construction details I will share with you in this and upcoming posts.
Requirements
My first step was to decide what kind of application to build. In the interest of learning ExtJS and at the same time building something simple and realistic, I established these as my main goals for the sample
- Use ExtJS as the presentation layer
- Use ExtJS’s AJAX requests as the way to “talk” to the server
- Be simple enough that it wouldn’t take a long time to build
- Be as close to a real-world application as possible without sacrificing items 1, 2 and 3
In terms of the type of application, I settled for a simple Knowledge Base System. I defined just a few usage scenarios that would keep it at a very basic level
- Browsing a collection of articles stored in a knowledge base repository
- Creation, edition or deletion of articles (any user can view, create, edit and delete any articles),
- View an article. The article’s visible attributes are
• Title
• Body
• Tags, as a way to connect the article to specific topics
• Author’s name
• Date published
These requirements are a good foundation to build upon later. I will revisit them in the future in order to bring the sample closer to a real-life system.
Having a good idea about the functional requirements and client-side technology choices, the next step was to decide how things were going to be on the server side. To channel all communications with my web client I decided to use a .NET http handler. For the articles repository, a binary file would go very well with my simplicity and short-construction-time requirements. Any data access and business logic would be placed inside class libraries.
Putting these building blocks in a diagram yields something like this

User Interface
Time to move on and take a stab at the layout of the web page. How’s is a user to interact with our Knowledge Base? I decided to use this familiar layout


The Articles Browser has a GridPanel that displays the list of articles in the knowledge base, an “article viewer” area where the properties of the selected article are shown, a TreePanel that displays the existing tags together with a count of articles that contain them, and an “article editor” window that allows for creating or editing articles.
Screenshots
What’s next
These are the changes I will be making in the future
- Add pagination capabilities to the “articles list” GridPanel
- Switch to a database-based model for storage of the articles
- Move string to resources file so it’s easier to localize the application
- Create user extensions for the main components
Downloads
Download the source code for this article: KnowledgeBase.zip


Jorge,
I have just about worn-out my copy of ExtJS 3.0 Cookbook. I use it extensively. Most of my work is mapping/GIS however, I am working on a web application for a customer and would like to use your portal layout that you document in your book. I have created portlets with a map and several graphs and grids. Works great when you first come to the page. However, when you delete a portlet and it goes into the library and then add it back, the content is no longer there. I am assuming I would need to re-build and perhaps track the session?
Thanks,
Mike
Yes, Mike, you would need to re-build. There are two common ways of keeping track of the deleted portlets, as well as the portlet positions:
- With cookies, if you only care about maintaining this on one computer.
- With server-side sessions, if you want to be able to re-build no matter what computer the user is running the application from.