2011-08-05 4 views
1

ラベルではなくフォルダアイコンが表示されます。私は数多くのデータソースを試しましたが、常に同じことです。ファイル、ajax呼び出し、テキスト、それは常に失敗します。フレックスツリーにラベルが表示されず、アイコンのみ

以下のコードでは、カスタムハンドラを設定してXMLが入るのを見ても、静的なテキストラベルを外に出すように設定しています。決して何も表示されません。これは、label関数とlabelFieldを使用せずに発生します。はい、100%確信しています。再度、さまざまなデータソースを試しました。

テキストを隠すのはわかりませんが、アイコンはわかりません。しかし、私もそれをチェックしました。

試しましたthis simple one file example、それはうまくコンパイルされます。

完全なコードは以下の通りです:

<?xml version="1.0" encoding="utf-8"?> 
<s:HGroup xmlns:fx="http://ns.adobe.com/mxml/2009" xmlns:s="library://ns.adobe.com/flex/spark" xmlns:mx="library://ns.adobe.com/flex/mx" width="100%" height="100%"> 
<fx:Declarations>  
    <fx:XML id="selectedData2" source="assets/xml/orgchartmodel.xml"/> 
</fx:Declarations> 

<fx:Script> 
    <![CDATA[ 

     private function tree_labelFunc(item:XML):String { 
      var label:String; 

      label = "flexisshit"; //breakpoint hits here but I never see this text 

      return label; 
     }   
    ]]> 
</fx:Script> 

<mx:Tree id="tree" dataProvider="{selectedData2}" labelFunction="tree_labelFunc" width="100%" height="100%" showRoot="false" textDecoration="underline" textSelectedColor="0xFFCCFF" depthColors="[#FFFFFF, #EEEEEE, #DDDDDD, #CCCCCC, #BBBBBB, #AAAAAA]" /> 
</s:HGroup> 

(図示一部のみ)の上で使用するXMLファイル

<employee layout="default" name="Eric Joplin" email="[email protected]" phone="555-0100" fax="555-0101" businessUnit="Management" status="present" gender="male"> 
<employee name="Gary Roberts" layout="left_below" email="[email protected]" phone="555-0100" fax="555-0101" businessUnit="Logistics" status="present" gender="male"> 
<employee layout="default" name="Alexander Burns" email="[email protected]" phone="555-0102" fax="555-0103" businessUnit="Logistics" status="present" gender="male"/> 
<employee layout="default" name="John Conner" email="[email protected]" phone="555-0104" fax="555-0105" businessUnit="Logistics" status="present" gender="male"/> 
</employee> 
<employe .... 
+0

フォントを埋め込んでいますか?あなたは2回埋め込む必要があるからです。 sparkコンポーネントでは1回、mxコンポーネントでは1回です。 –

+0

私は気づいていません。する必要がありますか?私は過去にフレックスを使ってきましたが、ツリーのためにそれを必要としていることは思い出されません。 – Maximegalon

答えて

1

私はあなたのコードをテストし、私はあなたが持っている推測しているので、それは私の作品フォントを埋め込んでいるどこかのCSSやいくつかのコード。 mx:TreeのfontFamilyを直接Verdanaに設定してみてください。

<mx:Tree id="tree" 
     fontFamily="Verdana" 
     width="100%" height="100%" 
     textDecoration="underline" 
     textSelectedColor="0xFFCCFF" 
     dataProvider="{xmlListColl}" 
     labelFunction="tree_labelFunc" 
     showRoot="false" 
     depthColors="[#FFFFFF, #EEEEEE, #DDDDDD, #CCCCCC, #BBBBBB, #AAAAAA]" 
     /> 
+0

感謝します!このコードは、問題を解決した私の直接のコントロール外から来ていました。あなたへの誇り。 – Maximegalon

+0

はい、そのようなことは過去にも私を狂わせました。 –

関連する問題