PDA

View Full Version : [CLOSED] Store_ReadData does not execute when type something int the filter header input.



tobros
Nov 01, 2013, 6:59 AM
i follow the example :http://examples2.ext.net/#/GridPanel/FilterHeader/Remote/
my code below:


<ColumnModel>
<Columns>
<ext:Column ID="Column1" runat="server" Width="240" Text="现金流量项目" DataIndex="CashFlowName">
<Editor>
<ext:DropDownField ID="DropDownField1" runat="server" Mode="ValueText" MatchFieldWidth="False" Editable="False">
<Component>
<ext:GridPanel runat="server" Width="350" ID="cb_cash_flow_item" StoreID="s_cash_flow_item">

<ColumnModel>
<Columns>
<ext:Column ID="Column2" runat="server" Text="项目编码" DataIndex="CashFlowCode"></ext:Column>
<ext:Column ID="Column3" runat="server" Text="项目名称" Flex="1" DataIndex="CashFlowName"></ext:Column>
</Columns>
</ColumnModel>
<BottomBar>
<ext:Toolbar ID="Toolbar1" runat="server">
<Items>
<ext:PagingToolbar ID="PagingToolbar2" StoreID="s_cash_flow_item" runat="server"></ext:PagingToolbar>
</Items>
</ext:Toolbar>
</BottomBar>
<Listeners>
<ItemClick Handler="this.dropDownField.setValue(record.data.CashFlowId ,record.data.CashFlowName);"></ItemClick>
</Listeners>
<Plugins>
<ext:FilterHeader ID="FilterHeader1" runat="server" Remote="true" />
</Plugins>
</ext:GridPanel>

</Component>
</ext:DropDownField>


</Editor>
<Renderer Fn="render_xjll"></Renderer>
</ext:Column>
<ext:NumberColumn ID="NumberColumn1" runat="server" Width="120" Text="分配金额" DataIndex="Fpje">
<Editor>
<ext:NumberField ID="NumberField1" runat="server"></ext:NumberField>
</Editor>
</ext:NumberColumn>
</Columns>
</ColumnModel>



<ext:Store runat="server" ID="s_cash_flow_item" PageSize="10" OnReadData="Store_ReadData">
<Model>
<ext:Model ID="Model3" runat="server" IDProperty="CashFlowId">
<Fields>
<ext:ModelField Name="CashFlowId"></ext:ModelField>
<ext:ModelField Name="CashFlowCode"></ext:ModelField>
<ext:ModelField Name="CashFlowName"></ext:ModelField>
</Fields>
</ext:Model>
</Model>
<Proxy>
<ext:PageProxy></ext:PageProxy>
</Proxy>

</ext:Store>



protected void Store_ReadData(object sender, StoreReadDataEventArgs e)
{
FilterHeaderConditions fhc = new FilterHeaderConditions(e.Parameters["filterheader"]);
foreach (FilterHeaderCondition condition in fhc.Conditions)
{
string dataIndex = condition.DataIndex;
FilterType type = condition.Type;
string op = condition.Operator;
object value = null;
}
//加载calshflowitem
var start = e.Start;
var limit = e.Limit;
int total;
s_cash_flow_item.DataSource = cashFlowItemService.AllDataPage(start,limit,out total);
e.Total = total;
s_cash_flow_item.DataBind();
}

can you tell me what i am missing? thank you .

Daniil
Nov 01, 2013, 10:41 AM
Hi @tobros,

Please set up some Type for all the ModelFields.

Though, we will investigate a possibility to get it working without any Type for a ModelField.

Daniil
Nov 04, 2013, 5:00 AM
Though, we will investigate a possibility to get it working without any Type for a ModelField.

It has been fixed in the SVN trunk.