Archive for the ‘web’ Category
Constraining ExtJs Floating Windows
There are plenty of examples of creating floating windows with ExtJs. However, they all allow the window to be dragged wherever the user chooses. ExtJs supports a ‘constrain’ property on the window. If you just set this to true, then the user cannot drag the window outside of the browser viewport.
However, what if you want to be fancier, and constrain it inside of some other container? It seems obvious, but finding the answer is difficult. People on the ExtJs forums have posted this question, but the responses are generally a step away from being the real answer.
The answer is the renderTo config property, which you should point to the body property of the container. The forum responses generally indicate this, but they fail to mention the body property. This is what works for panels, I haven’t looked at all the other containers. But I have a feeling the concept would still apply.
var myPanel = new Ext.Panel({
...
});
var testWin = new Ext.Window({
title: 'Test',
width: 300,
height: 300,
renderTo: myPanel.body,
constrain: true,
});
testWin.show();
Grails + ExtJs
Looking at the beginnings of a new webapp. I’m heavily leaning towards Grails+ExtJs, even though the ExtJs plugin has been discontinued because of the license change. Honestly, paying for developer licenses is not a big deal in the grand scheme of things. For widgets, dojo seems to be a runner-up, however it just doesn’t feel as polished, and I find the experience somewhat lacking. I wish jquery had a more mature & official widget set, because it would be my first choice.
In my previous project, we used JSF 1.2 + RichFaces. While I feel that combination can produce good results, it didn’t feel very agile. On a new JSF project going forward, I would recommend Seam; however it is not worth the effort to retrofit a large project.
James Lorenzen has a post about how to roll your own ExtJs plugin for grails, which I will probably give a shot.
With JSF, we were pushing markup down to the browser using ajax polling & rerendering of components. However, I want to start using RESTful services along with Comet. This should get interesting…