vendredi 20 mars 2015

Dojo binding data at index 0 from array to widget

I have an java script object and i am attempting to bind the object to a widget at index 0 however i am unable to get binding to work for array objects.


I do not wish to repeat the widget for each record in the array i would simply like to bind the widget only to the salary1 in the companyList at index 0.


Array:



data = new Stateful({
companyList:[{id:1, salary1:300.00, salary2:200.00, salary3:400.00}]
});


HTML:



<span title="(a) Salary For Month One :" data-dojo-type="dijit/_WidgetBase"
data-dojo-props="target:at(data,'companyList')">

<s:textfield type="text" name="salary1" required="true"
id="Salary1Id" placeholder="Salary Month One (e.g. 1234.00)"
trim="true" data-dojo-type="dijit/form/CurrencyTextBox"
data-dojo-props="value:at('rel:','salary1'),uppercase:true ,constraints:{fractional:true}, currency:'USD'"/>

</span>

Aucun commentaire:

Enregistrer un commentaire