PDA

View Full Version : Why does Ext 4.2 use x-form-trigger-first and 4.1 used x-form-trigger-last?



Jangla
29 Apr 2014, 10:31 AM
So you have a combo box that has a trigger.

In 4.1.x The last trigger button in a combo gets the cls (amongst others) of x-form-trigger-last:



...
triggerConfigs[i - 1].cn.cls += ' ' + triggerBaseCls + '-last';
...



But in 4.2 the *first* trigger gets x-form-trigger-first:



...
triggerConfigs[0].cn.cls += ' ' + triggerBaseCls + '-first';
...


Why is that such a problem?

Because you can always guarantee the position of the last trigger but not the first - last is always the right-most, first is only right-most if there's only one trigger.

So if, for example you want to make sure your right most trigger has a right border but others don't - easy in 4.1 and very difficult in 4.2:

http://puu.sh/8sugl/2b87a8662c.png

Looking at the markup you can see why:

http://puu.sh/8suwD/d10ab162b4.png

If the triggers were in the same table cell, we could rely on :first-of-type, :last-of-type. But they're not.

I can't see any meaningful reason why this change would be necessary. Can anyone help enlighten me? :)

Jangla
15 Apr 2015, 2:57 AM
Bumping this as I'm finally getting round to our upgrade and this is still an annoying problem I'm going to have to fix....somehow.