Sep 25, 2014, 11:36 PM
[CLOSED] Adding a Convert handler to a ModelField created dynamically
I am generating a datastore in my C# codebehind that looks kind of like this:
Thanks in advance.
<ext:Store ID="stor1" runat="server" DataSourceID="sds1">
<Model>
<ext:Model runat="server" ID = "modlData" IDProperty = "StudentSeatLabel" >
<Fields>
<ext:ModelField Name="StudentSeatLabel" />
<ext:ModelField Name="StudentSeatLabelLength" Type="Int" />
<ext:ModelField Name="StudentSeatLabelSort" Type="String" >
<Convert Handler="return getSortableSeatNumber(record)" />
</ext:ModelField>
</Fields>
</ext:Model>
</ext:Store>
The first two fields are easy: this.stor1.Model.Clear();
this.stor1.Model.Add(new Model { ID = "modlData", IDProperty = "StudentSeatLabel" });
this.stor1.Model[0].Fields.Add(new ModelField("StudentSeatLabel"));
this.stor1.Model[0].Fields.Add(new ModelField.Config { Name = "StudentSeatLabelLength", Type = ModelFieldType.Int });
this.stor1.Model[0].Fields.Add(new ModelField.Config { Name = "StudentSeatLabelSort", Type = ModelFieldType.Int });
However when I try to set the Convert property I am told it is read only. How can I configure this dynamic store to match the markup previously listed. (I am using Ext.net 2.5) Thanks in advance.
Last edited by Daniil; Sep 27, 2014 at 7:25 AM.
Reason: [CLOSED]