Apr 17, 2012, 1:54 PM
[CLOSED] FormPanel renderization bug when LabelAlign and MsgTarget are set
When button1 is clicked, the data is loaded and the the form renders correctly because the data meets the form´s requirements. basically, the Name field of Form does not allow blank text and the data loaded has this property filled.
But when i click button2 AFTER clicking button1 the data loaded does not this property filled and the following bug occurs.
it happens because the LabelAlign property is set to Top and MsgTarget property is set to Side
Any ideas to overcome this problem?
But when i click button2 AFTER clicking button1 the data loaded does not this property filled and the following bug occurs.
it happens because the LabelAlign property is set to Top and MsgTarget property is set to Side
Any ideas to overcome this problem?
<ext:FormPanel ID="FormPanel1" runat="server" Title="Form Panel" Width="300">
<FieldDefaults LabelAlign="Top" MsgTarget="Side" />
<Items>
<ext:TextField Name="ID" FieldLabel="ID" AnchorHorizontal="100%" runat="server" />
<ext:TextField Name="Name" FieldLabel="Name" AllowBlank="false" AnchorHorizontal="100%" runat="server" />
</Items>
<Buttons>
<ext:Button ID="button1" runat="server" Text="Old">
<Listeners>
<Click Handler="loadRecord(false);" />
</Listeners>
</ext:Button>
<ext:Button ID="button2" runat="server" Text="New">
<Listeners>
<Click Handler="loadRecord(true);" />
</Listeners>
</ext:Button>
</Buttons>
<Bin>
<ext:Store ID="Store2" runat="server" AutoLoad="false" PageSize="1">
<Model>
<ext:Model ID="Model2" IDProperty="ID" runat="server">
<Fields>
<ext:ModelField Name="ID" />
<ext:ModelField Name="Name" />
</Fields>
</ext:Model>
</Model>
</ext:Store>
</Bin>
</ext:FormPanel>
<script type="text/javascript">
var loadRecord = function (loadNew) {
Ext.net.DirectMethod.request({
url: "/Example/Test",
cleanRequest: true,
params: {
loadNew: loadNew
},
success: function (result) {
App.Store2.loadRawData(result);
var record = App.Store2.getAt(0);
App.FormPanel1.getForm().loadRecord(record);
}
});
}
</script>
public AjaxResult Test(bool loadNew)
{
AjaxResult ajx = new AjaxResult();
if (loadNew)
{
ajx.Result = new Person();
}
else
{
ajx.Result = new Person { ID = 1, Name = "EXT"};
}
return ajx;
}
Last edited by Daniil; Apr 20, 2012 at 6:55 PM.
Reason: [CLOSED]