Not able to remove duplicate from the filter option

6 posts, 0 answers
  1. neetu
    neetu avatar
    1 posts
    Member since:
    Apr 2008

    Posted 28 Feb 2017 Link to this post

    Hi ,

      On a KENDO Grid , if i set " multi: true, search: true, dataSource: ds" for the checkboxes option on filter , it shows the duplicate records of the datasource on filter checkboxes. Below please see the code for reference.

     

     var grid = $("#grid2").kendoGrid({

                        dataSource: ds,

                        columnMenu: {
                            columns: false
                        },
                        columns: [
                             { title: "ID", field: "DocumentID", width: 100 },
                             { title: "Region", field: "Region", width: 100, filterable: {  multi: true, dataSource: [{ Region: "HQ" }, { Region: "EAPRO" }] }, lockable: true },
                             { title: "Office", field: "Office", width: 100  , filterable: { multi: true,  dataSource: [{ Office: "" }] }, lockable: true},
                             { title: "YOC", field: "YearofCompletion", width: 100 },
                             { title: "Title", field: "Title", width: 100 },
                             { title: "Status", field: "Status", width: 100, filterable: { multi: true, dataSource: [{ Status: "On-track" }] }, lockable: true },
                             { title: "Sector", field: "SectorMirror", width: 100, filterable: { multi: true, search: true, dataSource: ds }, lockable: true },
                             { title: "Type", field: "Type", width: 100, filterable: { multi: true,  search: true, dataSource: ds }, lockable: true },
                             { title: "Phase", field: "Phase", width: 100, filterable: { multi: true, dataSource: [{ Phase: "Planning" }] }, lockable: true },
                             { title: "Language", field: "Language", width: 100, filterable: { multi: true, dataSource: [{ Language: "English" }] }, lockable: true },
                             { title: "Rating", field: "Rating", width: 100, filterable: { multi: true, search: true, dataSource: ds }, lockable: true }
                        ],
                        filterable: { mode: "menu" },
                       // mode: "menu",

     

    Thanks,

    neetu 

  2. Konstantin Dikov
    Admin
    Konstantin Dikov avatar
    2466 posts

    Posted 02 Mar 2017 Link to this post

    Hello Neetu,

    If you are going to use the same dataSource from the Grid you do not need to explicitly set it in the column. However, if you need to use separate dataSource for the filter you should return only unique values as demonstrated for the second Grid in the following online demo:

    Best Regards,
    Konstantin Dikov
    Telerik by Progress
    Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
  3. Rajesh
    Rajesh avatar
    4 posts
    Member since:
    Nov 2017

    Posted 05 Oct 2018 in reply to Konstantin Dikov Link to this post

    Same issue to me.

    i pass my data source to my columns then i'm getting duplicates 

    if i wont pass data source my filter is not working like excel filter 

    my requirement is :-- in grid widget 

    1).i want apply excel find of filers

     i got these example url  https://docs.telerik.com/kendo-ui/controls/data-management/grid/how-to/filtering/grid-with-excel-like-filter

    2).filter options should be sort 

     i got these example url   http://dojo.telerik.com/AyEca/2  

    3).filter options should be duplicates 

    i got these example url  https://docs.telerik.com/kendo-ui/controls/data-management/grid/how-to/filtering/checkbox-filter-menu

     

    how do i add these 3 scenarios on my grid filter

    can any once guide me 

  4. Konstantin Dikov
    Admin
    Konstantin Dikov avatar
    2466 posts

    Posted 09 Oct 2018 Link to this post

    Hi Fezile,

    Could you please take a look at the following HowTo example and see if the result meets your requirements:
    The following example also shows sorted multi checkbox filter, so could you please elaborate what from your requirements is not fulfilled with it:
    Looking forward to your reply.


    Regards,
    Konstantin Dikov
    Progress Telerik
    Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
  5. Rajesh
    Rajesh avatar
    4 posts
    Member since:
    Nov 2017

    Posted 12 Oct 2018 Link to this post

    HI Konstantin,

    Thanks to reply me.

    i don't know why same example urls are giving.i got those example urls before by using those example urls i couldn't achieve my requirement.

    on jquery grid widget issue 

    My requirement is:--

    i'm using column menu int event not filter menu int 

    every one giving me filter menu int examples .try to use column menu int event 

    1).grid filter options should be sort 

    2).no duplicates on filter options

    3).when we search record on filter search box then select all options is disappearing .i want implement always visible select all. options. 

    4)if i apply filter then those values should be appear on filter options not total page size values.

    5).filter options values should be come current page size values,not total page size values. but i'm getting  total page size values

     

    please create a example dojo url  then apply these requirements then forward me.

    please dont suggest me examples urls it couldn't help me.

    Thanks In Advance.

     

     

     

  6. Konstantin Dikov
    Admin
    Konstantin Dikov avatar
    2466 posts

    Posted 16 Oct 2018 Link to this post

    Hello Fezile,

    Please take a look at the following dojo example with enabled columnMenu:
    The logic for sorting the UnitsInStock filter checkboxes is moved to the columnMenuInit event, but if you want to update them each time the column menu is opened, you could use the columnMenuOpen event instead. Additionally, for unique values you will have to manually remove the duplicates returned by the "view" or "data" method, before passing the data to the filter.


    Regards,
    Konstantin Dikov
    Progress Telerik
    Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
Back to Top