Jul 26, 2018, 2:44 PM
[CLOSED] Mapping text in ListFilter
Hello
It is possible to map values in a "ext:ListFilter"?
We have a dataset with values 'Y' and 'N', in the GridPanel is mapped with Y=Si, and N=No, with a Renderer Handler in the column
But in the filter still appear 'Y' and 'N', and we want Y=Si, and N=No too
here is a example for ext.net 4.5.1.0
It is possible to map values in a "ext:ListFilter"?
We have a dataset with values 'Y' and 'N', in the GridPanel is mapped with Y=Si, and N=No, with a Renderer Handler in the column
But in the filter still appear 'Y' and 'N', and we want Y=Si, and N=No too
here is a example for ext.net 4.5.1.0
<%@ Page Language="C#" %>
<script runat="server">
protected void Page_Load(object sender, EventArgs e)
{
if (!X.IsAjaxRequest)
{
this.Store1.DataSource = new object[]
{
new object[] { "Y" }, new object[] { "Y" }, new object[] { "Y" },
new object[] { "N" }, new object[] { "N" }, new object[] { "N" }
};
Store1.DataBind();
}
}
</script>
<!DOCTYPE html>
<html>
<head runat="server">
<title>Test</title>
</head>
<body>
<ext:ResourceManager runat="server" />
<ext:Viewport runat="server" MarginSpec="0 0 10 0">
<LayoutConfig>
<ext:VBoxLayoutConfig Align="Center" Pack="Center" />
</LayoutConfig>
<Items>
<ext:GridPanel
runat="server"
Frame="true"
Width="400"
Height="295">
<Store>
<ext:Store ID="Store1" runat="server">
<Model>
<ext:Model runat="server">
<Fields>
<ext:ModelField Name="company" />
</Fields>
</ext:Model>
</Model>
</ext:Store>
</Store>
<Plugins>
<ext:GridFilters runat="server" MenuFilterText="Filter" />
</Plugins>
<ColumnModel runat="server">
<Columns>
<ext:Column runat="server" Text="Company" DataIndex="company" Width="300">
<Renderer Handler="return ((value) == 'Y' ? 'Si' : 'No');" />
<Filter>
<ext:ListFilter DataIndex="company" >
<Listeners>
<Deactivate Handler="this.menu.items.each(function (item) {item.setChecked(false);});" />
</Listeners>
</ext:ListFilter>
</Filter>
</ext:Column>
</Columns>
</ColumnModel>
</ext:GridPanel>
</Items>
</ext:Viewport>
</body>
</html>
Last edited by fabricio.murta; Jul 31, 2018 at 2:31 PM.