Apr 25, 2011, 8:27 PM
exclude store column from Server Side code
Hi
I have a Store to which I add a Field for Client Side reasons. However, is there any way of setting this so it isn't posted to the Server.
My Store:
Thanks
I have a Store to which I add a Field for Client Side reasons. However, is there any way of setting this so it isn't posted to the Server.
My Store:
<ext:Store ID="masterAccountAddressesStore" runat="server" AutoLoad="true">
<UpdateProxy>
<ext:HttpWriteProxy Url="/Client/SaveClientAddresses/" />
</UpdateProxy>
<Reader>
<ext:JsonReader>
<Fields>
<ext:RecordField Name="Id" Type="Int" />
<ext:RecordField Name="MasterAccountId" Type="Int" />
<ext:RecordField Name="Address1" />
<ext:RecordField Name="Address2" />
<ext:RecordField Name="Address3" />
<ext:RecordField Name="Address4" />
<ext:RecordField Name="Address5" />
<ext:RecordField Name="Postcode" />
<ext:RecordField Name="Active" Type="Boolean" />
</Fields>
</ext:JsonReader>
</Reader>
<Listeners>
<Load Handler="addDefaultFieldToAddressStore()" />
</Listeners>
</ext:Store>
I add a Field to this via javascript:function addDefaultFieldToAddressStore() {
var addressPanelStore = MainContent_masterAccountRelatedAddressesGridPanel.getStore();
addressPanelStore.addField({
name: "Default",
type: "Boolean"
});
However when I try to recreate the ClientAddresses on the Server side I get an exception because, I assume, of the additional Field:public AjaxStoreResult SaveClientAddresses() {
AjaxStoreResult result = new AjaxStoreResult(StoreResponseFormat.Save);
try {
StoreDataHandler dataHandler = new StoreDataHandler(HttpContext.Request["data"]);
ChangeRecords<ClientAddress> addresses = dataHandler.ObjectData<ClientAddress>();
foreach (ClientAddress address in addresses.Deleted) {
}
foreach (ClientAddress address in addresses.Updated) {
}
foreach (ClientAddress address in addresses.Created) {
}
}
catch (Exception e) {
}
}
Is there any setting I can set so the added Boolean Field 'Default' is not Posted back via Context.Request["data"]Thanks
Last edited by geoffrey.mcgill; Apr 25, 2011 at 9:39 PM.
Reason: please use [CODE] tags