Jan 08, 2014, 7:55 AM
[CLOSED] Add records with ModelProxy
Hi, I want to add many records in a Store, but I have many columns, so, I want to use the object ModelProxy, because I use
But, I don't know how to implent this object (ModelProxy), I am beging the example, but the contructor to ModelProxy It has a parameter AbstractStore, Could you please give me an example to ModelProxy in serverside?
sStore1.Add(new { Col1 = "Col11", Col2 = "Col12" ... Coln = "Col1n" });
So, It's a long line...But, I don't know how to implent this object (ModelProxy), I am beging the example, but the contructor to ModelProxy It has a parameter AbstractStore, Could you please give me an example to ModelProxy in serverside?
<ext:ResourceManager ID="ResourceManager1" runat="server" />
<ext:ComboBox
ID="cmbSucursal"
runat="server"
DisplayField="Nombre"
ValueField="Sucursal">
<Store>
<ext:Store ID="sSucursal" runat="server">
<DirectEvents>
<Load OnEvent="sSucursal_Load" />
</DirectEvents>
<Model>
<ext:Model ID="mSucursal" runat="server">
<Fields>
<ext:ModelField Name="Sucursal" Type="Int" />
<ext:ModelField Name="Nombre" Type="String" />
</Fields>
</ext:Model>
</Model>
</ext:Store>
</Store>
</ext:ComboBox>
protected void sSucursal_Load(object sender, DirectEventArgs e)
{
for (int i = 0; i < 5; i++)
sSucursal.Add(new { Sucursal = i, Nombre = "Nombre" + i });
//Add with ModelProxy other five records
//ModelProxy mp = new ModelProxy(
}
Last edited by Daniil; Jan 14, 2014 at 7:39 AM.
Reason: [CLOSED]