Not working: filter search, drop-down list

  1. #1

    Not working: filter search, drop-down list

    Hello World,

    I have searched but not found any answer that I understand, hopefully you can help me.
    :-)

    Please see attached image, unfortunally it is in Swedish but the function is the same without beeing language-dependent.

    When I press to the right of the column "Foretag"
    I got a drop-down.
    I choose "Filters".
    I write "Test"
    (There is a company "Testforetaget").

    I would like to get a hit, with the "Foretag" equal to "Testforetaget"

    (Foretag is the swedish word for company).

    It is doing something, the page I mean, but there is not any result given like "Testforetaget", I got the same page which I am visiting as answer.
    Yes, I have tried Test* also, no success ...

    As you might see from this question, I'm a beginner.

    Any advice ?

    Regards
    AndersClick image for larger version. 

Name:	Capture_06-07-2011_04-58-42 .jpg 
Views:	128 
Size:	57.6 KB 
ID:	2833
  2. #2
    Hi,

    The information is not enough.
    Do you have all required data on the client side? I meant what filtering do you need: remote or local?
    Please provide simple test sample which demonstrate your scenario
    Vladimir Shcheglov
    Sr. Developer
  3. #3

    Example

    Quote Originally Posted by Vladimir View Post
    Hi,

    The information is not enough.
    Do you have all required data on the client side? I meant what filtering do you need: remote or local?
    Please provide simple test sample which demonstrate your scenario

    One working set.
    One not working set.

    The working one, is SupplierList*

    The not working example, exactly from the screen-dump earlier, also included.
    Total of 4 files.
    Two working.
    Two not working.

    Regards
    Anders

    SupplierListCtrl.aspx =>
    <%@ Control Language="C#" AutoEventWireup="true" CodeBehind="SupplierListCtrl.ascx.cs" Inherits="BtPortal.UI.UserControls.Admin.SupplierListCtrl" %>
    <%@ Register Src="~/UserControls/Admin/SupplierDetailCtrl.ascx" TagName="SupplierDetailCtrl" TagPrefix="uc1" %>
    
    <ext:Store ID="SupplierStore" runat="server" AutoLoad="true" RemoteSort="true" OnRefreshData="SupplierStore_RefreshData" >
        <Proxy>
            <ext:DataSourceProxy />
        </Proxy>
        <Reader>
            <ext:JsonReader ReaderID="PartnerId">
                <Fields>
                    <ext:RecordField Name="PartnerId" />
                    <ext:RecordField Name="SupplierId" />
                    <ext:RecordField Name="Name" />
                    <ext:RecordField Name="SupplierNumber" />
                    <ext:RecordField Name="VisitingAddress" />
                    <ext:RecordField Name="Address" />
                    <ext:RecordField Name="ZipCode" />
                    <ext:RecordField Name="City" />
                    <ext:RecordField Name="Country" />
                    <ext:RecordField Name="Phone" />
                    <ext:RecordField Name="Fax" />
                    <ext:RecordField Name="EmailAddress" />
                    <ext:RecordField Name="Homepage" />
                    <ext:RecordField Name="ModifiedUserId" />
                    <ext:RecordField Name="Created" />
                    <ext:RecordField Name="Changed" />
                </Fields>
            </ext:JsonReader>
        </Reader>
        <BaseParams>
            <ext:Parameter Name="start" Value="0" Mode="Raw"/>
            <ext:Parameter Name="limit" Value="30" Mode="Raw"/>
            <ext:Parameter Name="sort" Value=""/>
            <ext:Parameter Name="dir" Value=""/>
        </BaseParams>
        <SortInfo Field="Name" Direction="ASC" />
    </ext:Store>
    
    <ext:ViewPort ID="ViewPort1" runat="server">
        <Body>
            <ext:BorderLayout ID="BorderLayout1" runat="server">
                <East MarginsSummary="5 5 5 0" Split="true">
                    <ext:Panel ID="Panel1" runat="server" Title="Filter" BodyStyle="padding: 8px;" Width="250" Collapsible="true" TitleCollapse="true" Collapsed="false" Visible="false">
                        <Body>
                            <ul>
                                <li>Produktkategori - BK04</li>
                                <li>
                                    <ext:MultiSelect runat="server" ID="ProductGroupsMultiSelect" Height="240" Width="230" KeepSelectionOnClick="WithCtrlKey">
                                        <Listeners>
                                            <Change Handler="#{SupplierGridPanel}.reload();" />
                                        </Listeners>
                                    </ext:MultiSelect>
                                </li>
                            </ul>
                        </Body>
                    </ext:Panel>
                </East>        
                <Center MarginsSummary="5 5 5 5">
                    <ext:Panel ID="Panel2" runat="server" Border="false" Header="false">
                        <Body>
                            <ext:FitLayout ID="FitLayout1" runat="server">
                                <ext:GridPanel ID="SupplierGridPanel" IDMode="Explicit" runat="server" StoreID="SupplierStore" AutoExpandColumn="EmailAddress">
                                   <TopBar>
                                        <ext:Toolbar ID="Toolbar1" runat="server">
                                            <Items>
                                                <ext:ToolbarButton ID="NewSupplierButton" runat="server" Text="Ny leverantör" Icon="UserAdd">
                                                    <AjaxEvents>
                                                        <Click OnEvent="NewSupplierButton_Clicked">
                                                            <EventMask ShowMask="true" Msg="Öppnar detaljfönster" Target="Page" />
                                                        </Click>
                                                    </AjaxEvents>
                                                </ext:ToolbarButton>
                                                <%-- robban REQ057 --%>
                                                <ext:ToolbarButton ID="ToolbarButton1" runat="server" Text="Leverantörer och kontaktpersoner"
                                                    Icon="PageExcel">
                                                    <AjaxEvents>
                                                        <Click OnEvent="SupplierAndContactsButton_Clicked" IsUpload="true">
                                                        </Click>
                                                    </AjaxEvents>
                                                </ext:ToolbarButton>
                                            </Items>
                                        </ext:Toolbar>
                                    </TopBar>
                                   <ColumnModel ID="ColumnModel1" runat="server">
                                        <Columns>
                                            <ext:Column DataIndex="Name" Header="Företag" ColumnID="NameCol" />
                                            <ext:Column DataIndex="SupplierNumber" ColumnID="RegNumber" Header="Leverantörsnr" Width="100" />
                                            <ext:Column DataIndex="City" ColumnID="City" Header="Stad" />
                                            <ext:Column DataIndex="Phone" ColumnID="Phone" Header="Telefon" />
                                            <ext:Column DataIndex="EmailAddress" ColumnID="EmailAddress" Header="Epost" />
                                            <ext:Column  ColumnID="Details" Header="Detaljer" Width="50" Align="Center" Fixed="true" MenuDisabled="true" Resizable="false">
                                                <Renderer Fn="supplierDetailsRender" />
                                            </ext:Column>
                                        </Columns>
                                   </ColumnModel>
                                   <SelectionModel>
                                        <ext:RowSelectionModel ID="RowSelectionModel1" runat="server" SingleSelect="true"></ext:RowSelectionModel>
                                   </SelectionModel>
                                   <BottomBar>
                                        <ext:PagingToolBar ID="PagingToolBar1" runat="server" StoreID="SupplierStore" PageSize="30"/>
                                   </BottomBar>
                                   <AjaxEvents>
                                        <CellClick OnEvent="SupplierGridPanel_CellClick">
                                            <ExtraParams>
                                                <ext:Parameter Name="PartnerId" Value="this.getSelectionModel().getSelected().id" Mode="Raw" />
                                            </ExtraParams>
                                            <EventMask ShowMask="true" Msg="Hämtar detaljer" Target="Page" />
                                        </CellClick>
                                        <RowDblClick OnEvent="SupplierGridPanel_RowDblClick">
                                            <ExtraParams>
                                                <ext:Parameter Name="PartnerId" Value="this.getSelectionModel().getSelected().id" Mode="Raw" />
                                            </ExtraParams>
                                            <EventMask ShowMask="true" Msg="Hämtar detaljer" Target="Page" />
                                        </RowDblClick>
                                   </AjaxEvents>
                                   <Plugins>
                                    <ext:GridFilters ID="SupplierGridFilters" runat="server">
                                        <Filters>
                                            <ext:StringFilter DataIndex="Name" />
                                            <ext:StringFilter DataIndex="SupplierNumber" />
                                            <ext:StringFilter DataIndex="City" />
                                            <ext:StringFilter DataIndex="Phone" />
                                            <ext:StringFilter DataIndex="EmailAddress" />
                                        </Filters>
                                    </ext:GridFilters>
                                   </Plugins>
                                   <Listeners>
                                        <CellClick Fn="SupplierGridPanel_CellClick" />
                                   </Listeners>
                                   <LoadMask Msg="Hämtar leverantör" ShowMask="true" />
                                </ext:GridPanel>
                             </ext:FitLayout>   
                        </Body>
                    </ext:Panel>
                </Center>
           </ext:BorderLayout>                
       </Body>
    </ext:ViewPort>        
    <uc1:SupplierDetailCtrl ID="SupplierDetailCtrl1" runat="server" />
    SupplierListCtrl.ascx.cs =>
    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Web;
    using System.Web.UI;
    using System.Web.UI.WebControls;
    using BtPortal.Utility.Excel;
    
    namespace BtPortal.UI.UserControls.Admin
    {
        public partial class SupplierListCtrl : Base.UserControlBase
        {
            protected void Page_Load(object sender, EventArgs e)
            {
                if (!Coolite.Ext.Web.Ext.IsAjaxRequest)
                {
                    BindProductGroups();
    
                    RegisterClientScriptInclude("/js/usercontrols/admin/supplierlistctrl.js", true);
                    RegisterClientScript(Lib.State.GridColumnsSettingsHelper.GetGridScript(this, SupplierGridPanel));
                }
            }
    
            private List<int> SelectedProductGroups
            {
                get
                {
                    List<int> res = new List<int>();
                    foreach (var item in ProductGroupsMultiSelect.SelectedItems)
                    {
                        res.Add(int.Parse(item.Value));
                    }
                    return res;
                }
            }
    
            private void BindProductGroups()
            {
                BtPortal.Logic.BL.ProductGroupManager pgMan = new BtPortal.Logic.BL.ProductGroupManager();
                List<BtPortal.Data.BO.ProductGroup> pgList = pgMan.GetAll().ToList<BtPortal.Data.BO.ProductGroup>();
    
                foreach (BtPortal.Data.BO.ProductGroup pg in pgList)
                {
                    Coolite.Ext.Web.ListItem item = new Coolite.Ext.Web.ListItem();
                    item.Text = pg.Label + " " + pg.Name;
                    item.Value = pg.ProductGroupId.ToString();
                    ProductGroupsMultiSelect.Items.Add(item);
                }
            }
    
            protected void SupplierStore_RefreshData(object sender, Coolite.Ext.Web.StoreRefreshDataEventArgs e)
            {
                BtPortal.Logic.BL.SupplierManager sMan = new BtPortal.Logic.BL.SupplierManager();
                BtPortal.Logic.Filter.FilterInfo fInfo = BtPortal.UI.Lib.Util.FilterHelper.CreateFilter(e.Parameters[SupplierGridFilters.ParamPrefix]);
    
                List<int> productGroups = SelectedProductGroups;
    
                e.TotalCount = sMan.GetFilterListIQueryable(fInfo, productGroups).Count();
    
                BtPortal.Logic.Filter.PagedSortInfo pInfo = new BtPortal.Logic.Filter.PagedSortInfo(e.Sort, e.Dir.ToString(), e.Start, e.Limit, e.TotalCount);
                SupplierStore.DataSource = sMan.GetFilterList(fInfo, pInfo, productGroups);
            }
    
            //robban REQ057
            protected void SupplierAndContactsButton_Clicked(object sender, Coolite.Ext.Web.AjaxEventArgs e)
            {
                BtPortal.Logic.BL.SupplierManager supMan = new BtPortal.Logic.BL.SupplierManager();
                UploadDocument(Lib.Util.ExcelHelper.CreateSupplierAndContactList(supMan.GetAllSuppliers()), "Leverantörer och kontakter");
            }
    
            //robban REQ057
            private void UploadDocument(ExcelBuilder excel, string filename)
            {
                try
                {
    
                    BtPortal.Logic.BL.ContentTypeManager ctMan = new BtPortal.Logic.BL.ContentTypeManager();
    
                    Response.ContentType = ctMan.GetForDocType(".xls");
                    Response.AppendHeader("Content-Disposition", "attachment; filename=" + filename + "_" + DateTime.Now.ToShortDateString() + ".xls");
                    excel.Save(Response.OutputStream);
                    Response.End();
                }
                catch (Exception)
                {
                    Coolite.Ext.Web.Ext.Msg.Show(new Coolite.Ext.Web.MessageBox.Config
                    {
                        Buttons = Coolite.Ext.Web.MessageBox.Button.OK,
                        Icon = Coolite.Ext.Web.MessageBox.Icon.ERROR,
                        Title = "Fel",
                        Message = "Kunde inte hämta filen"
                    });
                }
            }
    
            protected void NewSupplierButton_Clicked(object sender, Coolite.Ext.Web.AjaxEventArgs e)
            {
                SupplierDetailCtrl1.ShowDetails(null);
            }
    
            protected void SupplierGridPanel_CellClick(object sender, Coolite.Ext.Web.AjaxEventArgs e)
            {
                int partnerId;
                if (int.TryParse(e.ExtraParams["PartnerId"], out partnerId))
                {
                    SupplierDetailCtrl1.ShowDetails(partnerId);
                }
            }
    
            protected void SupplierGridPanel_RowDblClick(object sender, Coolite.Ext.Web.AjaxEventArgs e)
            {
                int partnerId;
                if (int.TryParse(e.ExtraParams["PartnerId"], out partnerId))
                {
                    SupplierDetailCtrl1.ShowDetails(partnerId);
                }
            }
        }
    }

    NOT WORKING =>
    SupplierContractsCtrl.aspx =>
    <%@ Control Language="C#" AutoEventWireup="true" CodeBehind="SupplierContractsCtrl.ascx.cs" Inherits="BtPortal.UI.UserControls.Supplier.SupplierContractsCtrl" %>
    <%@ Register Assembly="Coolite.Ext.Web" Namespace="Coolite.Ext.Web" TagPrefix="ext" %>
    <%@ Register Src="SupplierContractDetailCtrl.ascx" TagName="SupplierContractDetailCtrl" TagPrefix="uc1" %>
    
    <ext:Store runat="server" ID="ContractStore" AutoLoad="true" RemoteSort="true" OnRefreshData="ContractStore_RefreshData">
        <Proxy>
            <ext:DataSourceProxy />
        </Proxy>
        <Reader>
            <ext:JsonReader ReaderID="PartnerId">
                <Fields>
                    <ext:RecordField Name="PartnerId" />
                    <ext:RecordField Name="SupplierId" />
                    <ext:RecordField Name="SupplierNumber" />
                    <ext:RecordField Name="Name" />
                    <ext:RecordField Name="WorkingPriceList" />
                    <ext:RecordField Name="NewPriceList" Type="Date" DateFormat="Y-m-dTh:i:s" />
                    <ext:RecordField Name="LatestNews" Type="Date" DateFormat="Y-m-dTh:i:s" />
                    <ext:RecordField Name="LatestSupNews" Type="Date" DateFormat="Y-m-dTh:i:s" />
                    <ext:RecordField Name="LatestSupNewsId" />
                    <ext:RecordField Name="LatestNewsId" />
                </Fields>
            </ext:JsonReader>
        </Reader>
        <BaseParams>
            <ext:Parameter Name="start" Value="0" Mode="Raw" />
            <ext:Parameter Name="limit" Value="10" Mode="Raw" />
            <ext:Parameter Name="sort" Value="" />
            <ext:Parameter Name="dir" Value="" />
        </BaseParams>
        <SortInfo Field="Name" Direction="ASC" />
        <Listeners>
            <LoadException Handler="Ext.MessageBox.alert('Load failed', response.statusText);" />
        </Listeners>
    </ext:Store>
    
    <ext:ViewPort ID="ViewPort1" runat="server">
        <Body>
            <ext:BorderLayout ID="BorderLayout1" runat="server">
                <North MarginsSummary="5 5 5 5" Collapsible="true">
                    <ext:Panel ID="Panel1" runat="server" Title="Information" Icon="Information" Height="110" BodyStyle="padding: 5px;" Frame="true" Visible="false">
                        <Body>
                        <h2>Avtal</h2>
                        <p>...beskriv...</p>
                        </Body>
                    </ext:Panel>
                </North>
                <Center MarginsSummary="0 5 5 5">
                    <ext:Panel ID="Panel2" runat="server" Title="Avtal" Icon="Table">
                        <Body>
                            <ext:FitLayout ID="FitLayout1" runat="server">
                                <ext:GridPanel ID="ContractsGridPanel" IDMode="Explicit" runat="server" AutoExpandColumn="Name" StoreID="ContractStore">
                                    <SelectionModel>
                                        <ext:RowSelectionModel ID="RowSelectionModel1" runat="server" SingleSelect="true"></ext:RowSelectionModel>
                                    </SelectionModel>
                                    <ColumnModel>
                                        <Columns>
                                            <ext:Column Header="Lev-nr" DataIndex="SupplierNumber" ColumnID="SupplierNumber" />
                                            <ext:Column Header="Företag" DataIndex="Name" ColumnID="Name" />
                                            <ext:Column Header="Aktuell prislista" DataIndex="WorkingPriceList" ColumnID="WorkingPriceList">
                                                <Renderer Fn="renderBoolToSwedish" />
                                            </ext:Column>
                                            <%-- <ext:Column Header="Ny prislista" DataIndex="NewPriceList" ColumnID="NewPriceList">
                                                <Renderer Fn="Ext.util.Format.dateRenderer('Y-m-d')" />
                                                <Commands>
                                                    <ext:ImageCommand CommandName="PriceList" Icon="PageWhiteAcrobat">
                                                        <ToolTip Text="Senaste prislista" />
                                                    </ext:ImageCommand>
                                                </Commands>
                                            </ext:Column> --%>
                                            <ext:Column Header="Senaste nyhet" DataIndex="LatestNews" ColumnID="LatestNews">
                                                <Renderer Fn="Ext.util.Format.dateRenderer('Y-m-d')" />
                                                <Commands>
                                                    <ext:ImageCommand CommandName="ShowNews" Icon="Newspaper">
                                                        <ToolTip Text="Visa nyhet" />
                                                    </ext:ImageCommand>
                                                </Commands>
                                            </ext:Column>
                                            <ext:Column Header="Senaste lev-nyhet" DataIndex="LatestSupNews" ColumnID="LatestSupNews">
                                                <Renderer Fn="Ext.util.Format.dateRenderer('Y-m-d')" />
                                                <Commands>
                                                    <ext:ImageCommand CommandName="ShowSupplierNews" Icon="Newspaper">
                                                        <ToolTip Text="Visa leverantörsnyhet" />
                                                    </ext:ImageCommand>
                                                </Commands>
                                            </ext:Column>
                                            <ext:Column  ColumnID="Details" Header="Detaljer" Width="50" Align="Center" Fixed="true" MenuDisabled="true" Resizable="false">
                                                <Renderer Fn="contractDetailsRender" />
                                            </ext:Column>
                                        </Columns>
                                    </ColumnModel>
                                    <LoadMask ShowMask="true" />
                                    <AjaxEvents>
                                        <CellClick OnEvent="ContractsGridPanelGrid_CellClick">
                                            <ExtraParams>
                                                <ext:Parameter Name="PartnerId" Value="this.getSelectionModel().getSelected().id" Mode="Raw" />
                                            </ExtraParams>
                                            <EventMask ShowMask="true" Msg="Hämtar kontrakt" Target="Page" />
                                        </CellClick>
                                        <RowDblClick OnEvent="ContractsGridPanelGrid_RowDblClick" >
                                            <ExtraParams>
                                                <ext:Parameter Name="PartnerId" Value="this.getSelectionModel().getSelected().id" Mode="Raw" />
                                            </ExtraParams>
                                            <EventMask ShowMask="true" Msg="Hämtar kontrakt" Target="Page" />
                                        </RowDblClick>
                                        <Command OnEvent="ContractsGridPanel_Command">
                                            <ExtraParams>
                                                <ext:Parameter Name="command" Value="command" Mode="Raw" />
                                                <ext:Parameter Name="id" Value="record.id" Mode="Raw" />
                                            </ExtraParams>
                                        </Command>
                                    </AjaxEvents>
                                    <Listeners>
                                        <CellClick Fn="ContractsGridPanelGrid_CellClick" />
                                        <Command Fn="ContractsGridPanel_Command" />
                                    </Listeners>
                                    <Plugins>
                                        <ext:GridFilters runat="server" ID="ContractsGridFilters">
                                            <Filters>
                                                <ext:NumericFilter DataIndex="SupplierNumber" />
                                                <ext:StringFilter DataIndex="Name" />
                                                <ext:DateFilter DataIndex="NewPriceList">
                                                    <DatePickerOptions runat="server" TodayText="Now">
                                                    </DatePickerOptions>
                                                </ext:DateFilter>
                                                <ext:DateFilter DataIndex="LatestNews">
                                                    <DatePickerOptions runat="server" TodayText="Now">
                                                    </DatePickerOptions>
                                                </ext:DateFilter>
                                                <ext:DateFilter DataIndex="LatestProvNews">
                                                    <DatePickerOptions runat="server" TodayText="Now">
                                                    </DatePickerOptions>
                                                </ext:DateFilter>
                                            </Filters>
                                        </ext:GridFilters>
                                    </Plugins>
                                    <BottomBar>
                                        <ext:PagingToolbar ID="PagingToolBar1" runat="server" PageSize="10" StoreID="ContractStore"
                                            DisplayInfo="true" />
                                    </BottomBar>
                                </ext:GridPanel>
                            </ext:FitLayout>
                        </Body>
                    </ext:Panel>
                </Center>
                <East Collapsible="true" Split="false" MarginsSummary="0 5 5 0">
                    <ext:Panel ID="Panel3" runat="server" Title="Filter" Icon="Table" Width="250" BodyStyle="padding: 6px;" Visible="false">
                        <Body>
                            <ext:FormLayout ID="FormLayout1" runat="server" LabelAlign="Top">
                                <ext:Anchor Horizontal="95%">
                                    <ext:MultiSelect ID="BK04MultiSelect" runat="server" FieldLabel="Produktkategori - BK04" Height="240" Width="235">
                                        <Listeners>
                                            <Change Handler="#{ContractsGridPanel}.reload();" />
                                        </Listeners>
                                    </ext:MultiSelect>
                                </ext:Anchor>
                                <ext:Anchor Horizontal="95%">
                                    <ext:MultiSelect ID="MiscMultiSelect" runat="server" FieldLabel="Övrigt" Height="240" Width="235" Hidden="true">
                                        <Listeners>
                                            <Change Handler="#{ContractsGridPanel}.reload();" />
                                        </Listeners>
                                    </ext:MultiSelect>
                                </ext:Anchor>
                            </ext:FormLayout>
                        </Body>
                    </ext:Panel>
                </East>
            </ext:BorderLayout>
        </Body>
    </ext:ViewPort>
    
    <uc1:SupplierContractDetailCtrl ID="SupplierContractDetailCtrl1" runat="server" />
    
     <ext:Window 
        ID="NewsDetailsWindow"
        IDMode="Explicit"
        runat="server" 
        Icon="ApplicationFormEdit" 
        Width="500" 
        Height="400" 
        ShowOnLoad="false"
        Modal="true"
        Constrain="true"
        BodyStyle="background-color: #F7F7F0;">
        <AutoLoad 
            Url="/pages/news/newsreader.aspx" 
            Mode="IFrame" 
            TriggerEvent="show" 
            ReloadOnEvent="true" 
            ShowMask="true" 
            MaskMsg="Laddar...">
            <Params>
                <ext:Parameter Name="id" Value="" Mode="Value" />
                <ext:Parameter Name="type" Value="" Mode="Value" />
            </Params>
        </AutoLoad>
        <Buttons>
            <ext:Button runat="server" ID="btnDetailsCancel" Text="Stäng">
                <Listeners>
                    <Click Handler="#{NewsDetailsWindow}.hide();" />
                </Listeners>
            </ext:Button>
        </Buttons>
        <Listeners>
            <Hide Handler="#{NewsDetailsWindow}.clearContent();" />
        </Listeners>
    </ext:Window>
    SupplierContractsCtrl.ascx.cs =>
    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Web;
    using System.Web.UI;
    using System.Web.UI.WebControls;
    
    namespace BtPortal.UI.UserControls.Supplier
    {
        public partial class SupplierContractsCtrl : Base.UserControlBase
        {
            protected void Page_Load(object sender, EventArgs e)
            {
                if (!Coolite.Ext.Web.Ext.IsAjaxRequest)
                {
                    BindProductCategories();
    
                    RegisterClientScriptInclude("/js/usercontrols/supplier/suppliercontractsctrl.js", true);
                    RegisterClientScript(Lib.State.GridColumnsSettingsHelper.GetGridScript(this, ContractsGridPanel));
                }
            }
    
            private List<int> SelectedProductCategories
            {
                get
                {
                    List<int> res = new List<int>();
                    foreach (var item in BK04MultiSelect.SelectedItems)
                    {
                        res.Add(int.Parse(item.Value));
                    }
                    return res;
                }
            }
    
            private void BindProductCategories()
            {
                BtPortal.Logic.BL.ProductGroupManager pgMan = new BtPortal.Logic.BL.ProductGroupManager();
                List<BtPortal.Data.BO.ProductGroup> pgList = pgMan.GetAll().ToList();
    
                foreach (BtPortal.Data.BO.ProductGroup pg in pgList)
                {
                    Coolite.Ext.Web.ListItem item = new Coolite.Ext.Web.ListItem(pg.Label + " " + pg.Name, pg.ProductGroupId.ToString());
                    BK04MultiSelect.Items.Add(item);
                }
            }
    
            protected void ContractStore_RefreshData(object sender, Coolite.Ext.Web.StoreRefreshDataEventArgs e)
            {
                BtPortal.Logic.BL.SupplierContractManager scMan = new BtPortal.Logic.BL.SupplierContractManager();
                BtPortal.Logic.Filter.FilterInfo fInfo = BtPortal.UI.Lib.Util.FilterHelper.CreateFilter(e.Parameters[ContractsGridFilters.ParamPrefix]);
    
                List<int> pc = SelectedProductCategories;
    
                BtPortal.Logic.Filter.PagedSortInfo pInfo = new BtPortal.Logic.Filter.PagedSortInfo(e.Sort, e.Dir.ToString(), e.Start, e.Limit, 0);
                BtPortal.Logic.Filter.FilteredResult<BtPortal.Data.BO.BatchObjects.SupplierContract> filteredResult = scMan.GetFilteredElements(fInfo, pInfo, pc, Lib.State.UserContext.UserId);
                e.TotalCount = filteredResult.TotalCount;
                ContractStore.DataSource = filteredResult.FilteredElements;
            }
    
            protected void ContractsGridPanelGrid_CellClick(object sender, Coolite.Ext.Web.AjaxEventArgs e)
            {
                int partnerId;
                if (int.TryParse(e.ExtraParams["PartnerId"], out partnerId))
                {
                    SupplierContractDetailCtrl1.ShowDetails(partnerId);
                }
            }
            
            protected void ContractsGridPanelGrid_RowDblClick(object sender, Coolite.Ext.Web.AjaxEventArgs e)
            {
                int partnerId;
                if (int.TryParse(e.ExtraParams["PartnerId"], out partnerId))
                {
                    SupplierContractDetailCtrl1.ShowDetails(partnerId);
                }
            }
    
            protected void ContractsGridPanel_Command(object sender, Coolite.Ext.Web.AjaxEventArgs e)
            {
    
            }
        }
    }
  4. #4
    Hi,

    Please always simplify samples, post only required code (required to reproduce the issue)
    You have to use remote filtering, please investigate
    https://examples1.ext.net/#/GridPane...ilters_Remote/
    Vladimir Shcheglov
    Sr. Developer
  5. #5

    Thanks

    Quote Originally Posted by Vladimir View Post
    Hi,

    Please always simplify samples, post only required code (required to reproduce the issue)
    You have to use remote filtering, please investigate
    https://examples1.ext.net/#/GridPane...ilters_Remote/
    You have right.
    Unfortunally I'm a beginner in the case of Ext.net and C# so I have a lot of difficults to make the "right" sort when presenting code-example.
    I totally agree with your comment regarding examples and/or code.
    :-)

    Thanks for a GOOD JOB with an amazing framwork.
    :-)

    Of course, thanks for the link to the example.
    :-)

    Regards

Similar Threads

  1. Combobox Partial String Search for List Item
    By GolchK in forum 1.x Help
    Replies: 15
    Last Post: Jun 02, 2017, 12:51 AM
  2. How to use drop down list in ASP.Net Web Application
    By ali_raza159 in forum 2.x Help
    Replies: 1
    Last Post: Jun 19, 2012, 12:10 AM
  3. Replies: 2
    Last Post: May 01, 2012, 5:57 PM
  4. [CLOSED] [1.0] Custom Drop Down List Example
    By Ben in forum 1.x Legacy Premium Help
    Replies: 3
    Last Post: Jan 27, 2010, 12:20 PM
  5. Replies: 5
    Last Post: Dec 18, 2009, 10:50 AM

Tags for this Thread

Posting Permissions