Skip to main content

Working with Twitter Bootstrap in Creating Widgets

It has been a long time since I have blogged on a technical subject matter.  With MWLUG, iPhora, and family it has been very busy and every time I wanted to blog about some technical subject, time does not permit it.  Now that the office next to us is under construction this morning, it is a bit hard to concentrate on work. I have decided to blog on a subject matter that is of interest to many, Twitter Bootstrap.

I have talked about using Twitter Bootstrap in my applications in the past and I abandoned it because of its complexity.  I was interested in using Twitter Bootstrap as a responsive design framework.  However, I found that it was easier for me to use my own responsive design framework and Twitter Bootstrap was put on the shelve.

Since iPhora uses Dojo, all the widgets were Dijits which are a wonder piece of engineering, but they are also very complex and big.  I had already minimized the number of Dojo and Dijit modules that I needed to run the interface of the iPhora products but the loading performance was not what I wanted.  So I revisited Twitter Boostrap again, but not as a responsive design environment, but as a widget framework. One of the problems is that all the plug-ins for Bootstrap are written in JQuery which I would love to learn but I do not have the time. Kevin Armstrong created Dojo Bootstrap dojobootstrap.com using Dojo 1.7 + with AMD.  These dojo based plug-in work great, but I am still using dojo 1.52 though I am working on converting to 1.83. In addition, iPhora widgets have special widget wrappers not normally found in widgets.

So I decided to spend a weekend looking into the core of  the Twitter Bootstrap CSS and determine what I needed to create widgets using the Bootstrap CSS.  I had already developed my own custom widgets using Dojo only without using Dijits which eliminated the need to load the associate Dijit css and Dijit module files. However, I did not want to invest any more time into creating my own widgets design, since bootstrap provided a much better visual appearance.

First, I had to determine what bootstrap has already provided as part of the CSS and I was amazed on what was already there built into the bootstrap CSS.  I would never have the time to invest in building the core CSS.

I started off with a simple INPUT tag which gave me a better understanding on using Bootstrap CSS to  create widgets.  What amazed me was the responsive layout allowed me to create the concept of a "Responsive Widget" that I was looking into creating for awhile.  From the based components that you find on the Twitter Bootstrap site, http://twitter.github.com/bootstrap/index.html , like form, buttons, and inputs you can create amazing widgets quickly like the combo box below which is not part of the basic bootstrap widgets.  A Bootstrap combo box looks ugly:


Most of the work that I would normally do using Javascript is handle with CSS, because bootstrap is built from the ground up with HTML 5 in mind. Now that the construct is over with for the day.  It is back to work.  Next time, I will show how I built this widget.


Comments

Popular posts from this blog

The iPhora Journey - Part 8 - Flow-based Programming

After my last post in this series -- way back in September 2022, several things happened that prevented any further installments. First came CollabSphere 2022 and then CollabSphere 2023, and organizing international conferences can easily consume all of one's spare time. Throughout this same time period, our product development efforts continued at full speed and are just now coming to fruition, which means it is finally time to continue our blog series. So let's get started... As developers, most of us create applications through the conscious act of programming, either procedural, as many of us old-timers grew up with, or object-oriented, which we grudgingly had to admit was better. This is true whether we are using Java, LotusScript, C++ or Rust on Domino. (By the way, does anyone remember Pascal? When I was in school, I remember being told it was the language of the future, but for some reason it didn't seem to survive past the MTV era).  But in the last decade, there a

Creating Twitter Bootstrap Widgets - Part II - Let's Assemble

Creating Twitter Bootstrap Widgets - Part I - Anatomy of a Widget Creating Twitter Bootstrap Widgets - Part II - Let's Assemble Creating Twitter Bootstrap Widgets - Part IIIA - Using Dojo To Bring It Together This is two part of my five part series "Creating Twitter Bootstrap Widgets".   As I mentioned in part one of this series, Twitter Bootstrap widgets are built from a collection standard HTML elements, styled, and programmed to function as a single unit. The goal of this series is to teach you how to create a Bootstrap widget that utilizes the Bootstrap CSS and Dojo. The use of Dojo with Bootstrap is very limited with the exception of Kevin Armstrong who did an incredible job with his Dojo Bootstrap, http://dojobootstrap.com. Our example is a combo box that we are building to replace the standard Bootstrap combo box. In part one, we built a widget that looks like a combo box but did not have a drop down menu associated with it to allow the user to make a select

The iPhora Journey - Part 3 - Creating an Integrated UI Framework

The iPhora Journey - Part 1 - Reimagining Domino The iPhora Journey - Part 2 - Domino, the Little Engine that Could The iPhora Journey - Part 3 - Creating an Integrated UI Framework There are many ways to create the user interface (UI) for a web application. The HTML page could be created on the server and then pushed out. It could be static with the data generated on the page by the server with JavaScript, providing a more dynamic experience, or the server could generate new HTML content to update portions of the web page. XPages or PHP are good examples of this. Another method is to have the web page partially generated by the server and have JavaScript build the rest of the HTML by pulling data from the server via an API. This is the approach used in the Single Page Application (SPA) model. In all cases, it is still dependent on the web server technology being using.  As mentioned previously in this blog, XPages is dependent on complete integration between form and document, which e