May 2018


          1 2
3 4 5 6 7 8 9
10 11 12 13 14 15 16
17 18 19 20 21 22 23
24 25 26 27 28 29 30
31            
 
FEEDS
 
ARCHIVES
 
RECENT ENTRIES
 
OTHER BLOGGERS
 
AGGREGATORS
 
SOCIAL NETWORKS
:: 08/21/2005 ::
Flex'n in a Tight Corner
Return   Back To Top
I find that in some Flex apps you simply don't have enough room to display all the data in the allotted space. Here's something that I feel is a nice compromise - I truncate the data to the desired size, add some ellipses (as a visual clue that the data is abbreviated), and use the toolTip to display the entire data field.

Try It

Here's the sample code:

AS Code:

var sCompany:String = 'This Really Long Company Name Takes Up Too Much Space';

function abbrevi(sText) {
var CoName:String = sText;
var tmpCoNameLetter:String = '';
var tmpCoNameWord:String = '';
if (CoName.length > 23) {
CoName = CoName.toLowerCase();
tmpCoNameWord = CoName.substring(0, 1).toUpperCase();
//mx.controls.Alert.show(CoName);
var N:Number = (CoName.length);
for(var i=1; i<N; ++i) {
tmpCoNameLetter = CoName.substring(i, i+1);
if (tmpCoNameLetter == " ") {
tmpCoNameLetter = ' ' + CoName.substring(i, i+2).toUpperCase();
i++
}
tmpCoNameWord = tmpCoNameWord + tmpCoNameLetter;
}
sText = tmpCoNameWord.substring(0, 22) + '...';
} else {
sText = CoName;
}
return sText;
}

MXML Code:

<mx:TextInput id="tiCompany" text="{abbrevi(sCompany)}" toolTip="{sCompany}" />

* Update - Kevin Hoyt has an example of taking this idea to the next level here.

 

canada goose femme pas cher Soldes Louboutin Chaussures Soldes Louboutin louis vuitton taschen outlet louboutin outlet uk billig canada goose canada goose tilbud goyard pas cher longchamp bags outlet Monlcer udsalg billige parajumpers YSL replica sac louis vuitton pas cher Canada Goose Pas Cher Canada Goose Outlet UK Moncler Outlet uk goyard replica bags polo Lacoste pas cher Bolsos Longchamp España Moncler Jakker tilbud Doudoune moncler pas cher Parajumpers Jakker tilbud Ralph Lauren Soldes Parajumpers Outlet louis vuitton replica Moncler Jas sale Billiga Canada Goose Jacka Canada Goose outlet Billiga Moncler Doudoune Canada Goose Pas Cher Canada Goose Pas Cher Louboutin Soldes Canada Goose Pas Cher Hemers replica Doudoune Canada Goose Pas Cher prada replica Canada Goose Pas Cher Canada Goose Soldes Doudoune Canada Goose Pas Cher Canada Goose Pas Cher Canada Goose outlet Canada Goose outlet Canada Goose outlet