PDA

View Full Version : [CLOSED] how to pass a storeparamenter to a store in directmethod ?



hdsoso
May 28, 2015, 6:24 AM
i want to pass a parameter to a store , in aspx,


<ext:Store runat="server" ID="storeContract" OnReadData="LoadContract" AutoLoad="False">
<Parameters>
<ext:StoreParameter Name="bid"/>
</Parameters>

in cs,below set the value for the paramenter in directmethod , then triiger reload of the store.


[DirectMethod]
public void ShowBuildW(string buidinfoid)
{
var sp = new StoreParameter
{
Name = "bid",
Value = buidinfoid
};
var pc = new Ext.Net.ParameterCollection();
pc.Add(sp);
storeContract.Reload(pc);
}

below , get the parameter's value , but no work.


protected void LoadContract(object sender, StoreReadDataEventArgs e)
{
var bid = e.Parameters["bid"];
}

what's wrong , what I am missing or making a mistake?

Daniil
May 28, 2015, 3:42 PM
Hi @hdsoso,

Please remove


<Parameters>
<ext:StoreParameter Name="bid" />
</Parameters>
or set

<Parameters>
<ext:StoreParameter Name="bid" ApplyMode="IfNotExists" />
</Parameters>