1 週間ほど前から問題に取り組んでいますが、まだ期待どおりに動作させることができませんでした。ItemRenderer として CheckBox と Label を持つ HBox を持つ DataGrid があります (以下のコードを参照)。セルをタップすると、標準の itemEditor がポップアップ表示され、ラベルの内容を入力できます。それが標準的な動作です。私は2つの問題を除いて正常に動作します:
多くのテキストを入力すると、水平スクロールバーがポップアップし、セルがそのスクロールバーでいっぱいになります。ご覧のとおり、 horizontalScrollPolicy をオフに設定しようとしましたが、まったく機能しません...すべての異なる要素に対してそれを実行しようとしましたが、失敗はまだ存在しています。
複数の行を埋めると、別の間違いが発生します。行をタップすると、データグリッドはその行の下にある行を選択します。これは、1 行が既に選択されている場合のみです。データグリッドの外側をタップしてから、任意の行をタップすると、右側の行の itemEditor が表示されます... set data メソッドの設定に何か問題がありますか?
__
package components
{
import mx.containers.HBox;
import mx.controls.CheckBox;
import mx.controls.Label;
public class ChoiceRenderer extends HBox
{
private var correctAnswer:CheckBox;
private var choiceLabel:Label;
public function ChoiceRenderer()
{
super();
paint();
}
private function paint():void{
percentHeight = 100;
percentWidth = 100;
setStyle("horizontalScrollPolicy", "off");
super.setStyle("horizontalScrollPolicy", "off");
correctAnswer = new CheckBox;
correctAnswer.setStyle("horizontalScrollPolicy", "off");
addChild(correctAnswer);
choiceLabel = new Label;
choiceLabel.setStyle("horizontalScrollPolicy", "off");
addChild(choiceLabel);
}
override public function set data(xmldata:Object):void{
if(xmldata.name() == "BackSide"){
var xmlText:Object = xmldata.TextElements.TextElement.(@position == position)[0];
super.data = xmlText;
choiceLabel.text = xmlText.toString();
correctAnswer.selected = xmlText.@correct_answer;
}
}
}
前もって感謝します!マーカス