Filtering data befor a Combobox is loaded from a Store Object

  1. #1

    Filtering data befor a Combobox is loaded from a Store Object



    Hello,

    Given the following HTML source, how can I filter out some values before loading the Xml data into the Combobox if the user cannot see some items from it?

    
    <asp:XmlDataSource ID="XmlReferenceTablesDataSource1" runat="server" DataFile="ReferenceTables.xml"
        TransformFile="ReferenceTables.xsl"  />
    <ext:Store ID="storeReferenceTableList" runat="server" OnRefreshData="Refresh_References"
        OnSubmitData="Store1_Submit" DataSourceID="XmlReferenceTablesDataSource1" 
        AutoLoad="true" ondatabound="storeReferenceTableList_DataBound">
        <AjaxEventConfig IsUpload="true" />
        <Reader>
     <ext:JsonReader>
         <Fields>
      <ext:RecordField Name="Name" />
      <ext:RecordField Name="Description" />
      <ext:RecordField Name="TableSchemaName" />
         </Fields>
     </ext:JsonReader>
        </Reader>
        <SortInfo Field="Name" Direction="ASC" />
    </ext:Store>
    
    ...
    ...
    <ext:ComboBox ID="tablescmbx1" runat="server" 
      StoreID="storeReferenceTableList" 
      Editable="false"
                    DisplayField="Name" 
                    ValueField="TableSchemaName" 
                    TypeAhead="true" 
                    Mode="Local"
                    ForceSelection="true" 
                    EmptyText="Select a table..." 
                    Resizable="true" 
                    Select&#111;nfocus="true" 
                    TriggerAction="All">
         <AjaxEvents>   
     <Select OnEvent="tablescmbx1_Selected" ViewStateMode="Include">
         <ExtraParams>
       <ext:Parameter Name="TableName" Value="#{tablescmbx1}.getText()" Mode="Raw" /> 
         </ExtraParams>
    
    
     </Select>                        
          </AjaxEvents>
    </ext:ComboBox>
    If have tried the Store_DataBound and Store_DataBinding with no luck coming up with a good way to do this.

    Thank you in advance,
  2. #2

    RE: Filtering data befor a Combobox is loaded from a Store Object

    Hi,

    You can use XPath property of XmlDataSource to filter data. Here is some articles
    http://www.c-sharpcorner.com/UploadF...a-d75a508362d8
    http://www.beansoftware.com/ASP.NET-...e-Control.aspx


    Or you can read xml file manually, filter data and set filtered result to the Data property of XmlDataSource*

Similar Threads

  1. [CLOSED] Filtering a store with nested data
    By jchau in forum 1.x Legacy Premium Help
    Replies: 3
    Last Post: Dec 13, 2011, 1:27 PM
  2. Store original object from data source
    By nextSTEP in forum 1.x Help
    Replies: 8
    Last Post: Feb 16, 2011, 1:12 PM
  3. Replies: 0
    Last Post: Jun 26, 2009, 11:32 AM
  4. Replies: 0
    Last Post: Apr 14, 2009, 12:33 PM
  5. Replies: 8
    Last Post: Sep 06, 2008, 7:02 PM

Posting Permissions