the singularity of being and nothingness
Uncategorized
Ext JS 5: Routing Part II
Aug 23rd
In my last post, we explored the new routing functionality that has been incorporated in Ext JS 5. I had a lot of great feedback and discussions come from that (thanks!), so I thought I’d add a few more notes about some of the routing functionality that I didn’t discuss in the last post. So without further jabbering, let’s dive in.
Route ConditionsOne nice feature of routing in Ext JS 5 is that not only can you add a before handler to the route execution, but you can also filter routes which will be matched based on a regex string.
For example, let’s consider our users/:id route from the last post:
routes: { ... 'users/:id': { action: 'onUserDetail', before: 'onBeforeUserDetail' } }
As written, this route will match any hash in this form, regardless of what actual value is passed for our “id” placeholder. What this means is that if someone gets clever and starts to try to manually hack our hash with some value other than what comes naturally from our application, our before handler is still going to fire on the hacked value, and whatever code is in that handler will execute.
Obviously, we could put some error/hack handling in our before handler, but More >
ExtJS 4.2 Walkthrough — Post-Upgrade Bug
May 27th
In the last installment, we took a few moments to upgrade our app from ExtJS 4.2.0 to ExtJS 4.2.1. As I pointed out, upgrading is not an insignificant decision, as you will have to test and verify that your app continues to work as expected.
Well, in preparing the next several sections, I came across a bug in 4.2.1 that harms a bit of the functionality I was wanting to implement. While these bugs are a natural (albeit frustrating) part of software evolution, ExtJS is fortunately extensible enough that we can easily create a custom patch (or override) that will allow our code to work as expected WITHOUT modifying the core framework. The benefit of this approach, of course, is that we future-proof our code against new versions. So then, when the new version comes out, we can remove our custom patch and see if the issue is resolved in the core. If it’s not, we can simply re-enable our patch, submit another bug ticket :), and continue on.
Tips for Dealing with BugsBefore we fix this bug, let me offer a couple suggestions to mentally dealing with bugs in ExtJS:
- Acceptance: The first step to healthily dealing with bugs in ExtJS is to More >
ExtJS Quickie: Custom Event Domain
May 25th
With ExtJS 4.2 came the awesome concept of Event Domains. Basically, these allow you to let your Controllers know about ALOT more events within your applications. For example, in 4.1, you could use the control() method within your controller to listen to component-level events. However, with Event Domains, you can now listen to events in the following domains: Global, Controller, Component, Store.
This is awesome, but there are other domains that you might want to tap. No fear, the Event Domain is easily extensible to include others!
A Proxy DomainIn my applications, I generally have a single proxy that handles all my stores’ AJAX traffic. A common event listener for the proxy is the exception event, which fires in the case of a server error response. In the past, I’ve generally just added this to the listener config of the proxy itself, and went about my business.
The problem, of course, is that you generally want to DO something when an exception occurs, such as displaying an error message, resetting the state of a store, etc. The problem with defining the listener directly on the proxy is that you have to intrude your application upon the proxy to communicate the exception beyond the proxy.
But with a custom Event More >
ExtJS 4.2 Walkthrough – Part 2: Main Layout
May 19th
In the last post, we jumped through the hoops of setting up a brand new ExtJS 4.2 application, and we even “upgraded” it a bit by switching to the fresher “Neptune” theme. But after all of that, we were left with a fairly lame application. It works, of course, but doesn’t do anything. We need to fix that.
In this installment, we’ll take the mockup that we looked at previously and create some code to prepare the main skeletal sections of the app, including:
- The header
- The left side bar
- The main content area
Getting these in place will let us begin surgically creating various parts of our application. Hooray!
An Aside: Dynamic LoadingNote: Code for this installment can be found on GitHub.
Unless you specifically go another direction, ExtJS 4 applications are going to be a single-page application, driven by a single, “compiled” version of all the JS classes that are required to make your application run.
When developing the application, however, it is certainly not ideal to have to compile the application every time you want to make a change. To facilitate super-rapid development, ExtJS 4 includes a very robust Dynamic Loading system. While we won’t dwell on the intricacies of it here, this Dynamic Loading system allows More >
Sencha Touch 2: Ext.ux.field.TimePicker
Jan 27th
Today I wrapped up work on a custom Sencha Touch 2 form field component called TimePicker which, as indicated by its name, allows you to select a custom time via the faux-OS picker dialog.
There are a bunch of other TimePickers out there for Touch, but most are old or just don’t do what I want them to do. So I made my own 🙂
If you’re interested in using this, head over to my GitHub repo and pull it into your project. There’s a bunch of config, but it’s all documented in the repo.
If you do end up using it, please let me know what you think. I’d love feedback on usefulness, suggestions for improvements, etc.
Share this:Chunky Checker: Some CSS3 Fun
Jan 16th
In keeping with my New Year’s resolution to not get involved in “black-hole” projects so that I have more flexibility to pursue fun stuff on a whim, I whipped up a fun experiment in CSS3.
The Main IdeaIf you design a lot of forms, you know that radio and checkbox lists are hard to style. And no matter how perfectly you lay them out, they are still just plain boring. I thought it would be fun to make checkbox and radio lists a bit more fun by going an entirely different route, and by getting a bit more 3D.
Enter “Chunky Checker.” This set of styles takes an ordinary list of checkboxes or radio buttons and converts them into a super-chunky 3D list. As the radios/checkboxes are activated, the particular segment of the list transforms, creating a “depressed” look, sort of as if a button was physically pressed.
The MarkupThis approach is completely, 100% CSS and HTML–no JavaScript whatsoever. Moreover, it uses a pretty standard markup. The following is all that’s needed to recreate the demos:
<fieldset> <legend>Favorite Color:</legend> <input type="checkbox" name="color" value="Red" id="red" class="red"/> <label for="red">Red</label> <input type="checkbox" name="color" value="Orange" id="orange" class="orange" /> More >
In Memoriam
Nov 13th
Today, my family celebrates the life and commemorates the death of my grandfather, O. Dean Watson. Although I was unable to attend the memorial service, I wrote a few thoughts that I shared with my family.
Grandpa, you lived your life full of virtue–anyone who met you, and especially those who knew you well and loved you dearly, could immediately see that. You lived daily with immense compassion, purposeful integrity, and limitless generosity. Your words were always graced with good will, and you found—and brought out—the best in everyone, revealing to family, friends and strangers alike the love of God which filled your heart and soul.
And as if these great virtues were not sufficient, your life was marked indelibly by the deep faith which you held out for all to see. In good times and in bad, in rejoicing and in suffering, you always demonstrated the abiding trust you had in the promises of our Heavenly Father, a trust which you worked tirelessly and to your final days to cultivate in your family, your friends, and every person with whom you had a moment’s opportunity to fellowship. Even in the face of death, your confidence did not waiver, and courageously you More >
Spam of Biblical Proportions
Sep 13th
I recently had several comments like this left on an old blog. I have reproduced the offending comment, mostly untouched save for corrections of the more offensive grammatical errors 🙂
—-
If I speak in the Cheap Authentic NFL Jerseys of men and of angels, but have not love, I am only a resounding gong or a clanging cymbal.
If I have the gift of prophecy and can fathom all mysteries and all Official NFL Jerseys, and if I have a faith that can move mountains, but have not love, I am nothing.
If I give all I possess to the poor and surrender my USA Jerseys Shop to the flames,but have not love, I gain nothing.
Love is patient, NFL Jerseys are kind.
It does not envy, it does not boast, it is not proud. It is not rude, it is not self-seeking, it is not easily angered, NHL Jerseys keep no record of wrongs.
Love does not delight in evil but rejoices with the truth.
It always protects, always trusts, MLB Jerseys always hope, always persevere.
NHL Hockey Jerseys never fail.
But where there are prophecies, they will cease; where there are tongues, they will be stilled; where there is knowledge, it will pass away.
For More >