Hi Fabricio,
Thanks for replying fast.
Yes, I think the store is filtered for "[TEXT1, TEXT2]" as a string not or.
But, I try using "['TEXT1', 'TEXT2']" and it still not working.
Its pretty hard to copy all the code. But this are some important part of the code.
I have 2 grid.
<ext:GridPanel
runat="server"
ID="GPTop"
ClientIDMode="Static"
ColumnWidth="0.5"
Height="150"
Frame="true">
<Store>
<ext:Store
runat="server"
ID="storeTop">
<Model>
<ext:Model runat="server" IDProperty="code">
<Fields>
<ext:ModelField Name="code" />
<ext:ModelField Name="expand" />
</Fields>
</ext:Model>
</Model>
</ext:Store>
</Store>
<ColumnModel>
<Columns>
<ext:Column runat="server" Text="Manager" DataIndex="code" Flex="1" RightCommandAlign="false">
<Commands>
<ext:ImageCommand CommandName="Expand" Icon="Add" />
<ext:ImageCommand CommandName="Collapse" Icon="Delete" />
</Commands>
<DirectEvents>
<Command OnEvent="TopExpanded_DirectMethod">
<ExtraParams>
<ext:Parameter Name="code" Value="record.data.code" Mode="Raw" />
<ext:Parameter Name="expand" Value="record.data.expand" Mode="Raw" />
</ExtraParams>
</Command>
</DirectEvents>
</ext:Column>
</Columns>
</ColumnModel>
<SelectionModel>
<ext:CheckboxSelectionModel runat="server" Mode="Multi" CheckOnly="true" />
</SelectionModel>
</ext:GridPanel>
<ext:GridPanel
runat="server"
ID="GPBottom"
ClientIDMode="Static"
ColumnWidth="0.5"
Height="150"
Frame="true">
<Store>
<ext:Store
runat="server"
ID="storeBottom">
<Model>
<ext:Model runat="server" IDProperty="code">
<Fields>
<ext:ModelField Name="code" />
<ext:ModelField Name="topcode" />
</Fields>
</ext:Model>
</Model>
</ext:Store>
</Store>
<ColumnModel>
<Columns>
<ext:Column runat="server" Text="Employee" DataIndex="code" Flex="1" />
</Columns>
</ColumnModel>
<SelectionModel>
<ext:CheckboxSelectionModel runat="server" Mode="Multi" CheckOnly="true" />
</SelectionModel>
</ext:GridPanel>
And here is how I bind all the data to the grid.
Dim listManager As New List(Of Object())
listManager.Add(New Object() {"001", False})
listManager.Add(New Object() {"002", False})
listManager.Add(New Object() {"003", False})
listManager.Add(New Object() {"004", False})
storeTop.DataSource = listManager.ToArray()
storeTop.DataBind()
Dim listEmployee As New List(Of Object())
listEmployee.Add(New Object() {"101", "001"})
listEmployee.Add(New Object() {"102", "002"})
listEmployee.Add(New Object() {"103", "003"})
listEmployee.Add(New Object() {"104", "004"})
storeBottom.DataSource = listEmployee.ToArray()
storeBottom.DataBind()
storeBottom.Filter("topcode", "NULL")
And when user click on expand bottom in top list, I want to filter storeBottom to show only the expanded manager (the expand can be more than one).
I use direct method to refilter the storeBottom.
Public Sub TopExpanded_DirectMethod(sender As Object, e As DirectEventArgs)
Dim code As String = e.ExtraParams("code")
Dim expand As Boolean = Convert.ToBoolean(e.ExtraParams("expand"))
'Some Logic for creating list of code selected
Dim oDataFilters As New DataFilterCollection
Dim oDataFilter As New DataFilter
oDataFilter.Property = "topcode"
oDataFilter.Op = "in"
'This suppose to be list of code generated above. But for simplicity, I use hardcoded data.
oDataFilter.Value = "['001', '002']"
oDataFilters.Add(oDataFilter)
storeBottom.Filter(oDataFilters)
End Sub
With code above, I hope to get the store filtered and show only Employee 101 and 102.
But nothing showed.
Am I doing it wrong? What is the correct format for DataFilter value if the Op is "in"?
Or maybe there are any other way to do this?
Thanks