2010-10-22 3 views

Répondre

2

Seuls les ajouts et les suppressions à un dataProvider sont mis à jour automatiquement - pour les modifications d'un élément existant à refléter automatiquement, la propriété particulière en cours de mise à jour doit être déclarée [Bindable]. Vérifiez si la propriété name est liée ou non.

public class Item 
{ 
    public var noBinds:String = "initvalue"; 
    [Bindable] 
    public var bindMe:String = "initvalue"; 

    //a constructor that takes two arguments goes here 
} 

//dp is the dataProvider of a data grid with two columns: 

//this will add new item to the grid 
dp.addItem(new Item("blah", "blah1")); 

/* update the selected item */ 

//not bindable 
dp.selectedItem.noBinds = "new string; but not shown"; 

//update the Bindable item 
dp.selectedItem.bindMe = "new string; this will be updated"; 
+0

Merci! réponse parfaite! ;) –

Questions connexes