This is a migrated thread and some comments may be shown as answers.

Comma Delimited Search

4 Answers 544 Views
Grid
This is a migrated thread and some comments may be shown as answers.
David
Top achievements
Rank 1
David asked on 19 Feb 2016, 03:12 PM

Maybe this has been asked but I'm having trouble finding it.  I already have a filter and I don't need a comma delimited filter. I want to search multiple "Strings" under the same filter. If the filter is say "DOGS", then I want to search multiple "types" of dogs under that filter, comma d,e,l,i,m,i,t,e,d.

 

Filter: [dogs]

Search String: "pugs, dachsunds, chahuahua, beagle"

Row Return:

1.) pugs

 2.) dachsunds

3.) custom row (message:'no chahuahuas found')
4.) beagle


I can do the query on each value of the split(",") just fine but I need to return a row for each. So I need to search on one string, then search on another without clearing the previous row. This would produce the desired effect. 

Thanks for any help. Below is some more context:

CURRENT SEARCH FUNCTION:

           // Get Selected FilterType 

           function getSelectedFilters(){
                return angular.element('.selected-filter').find(".selected").attr("filter-value");
            }

            //Search based on dynamic filter - onkeyup
            angular.element('#SearchBox').keyup(function (e){
                let searchString = e.target.value;
                let filterType = getSelectedFilters();
                    angular.element('#Grid').data('kendoGrid').dataSource.query({
                        page:1, pageSize:20,
                        filter:{
                          logic:"or",
                          filters:[
                            {field:filterType, operator:"contains",value:searchString}
                          ]
                        }
                    });

------------------------------------

where i need to be:

            ....each( stringArr, function( i, val ) {

                    angular.element('#Grid').data('kendoGrid').dataSource.query({
                        page:1, pageSize:20, filter:{
                          logic:"or",
                          filters:[
                            {field:filterType, operator:"contains",value:val[i]} ...

                            ... (return row on first [i], then an additional row on [i++], etc ) ...

 

4 Answers, 1 is accepted

Sort by
0
Boyan Dimitrov
Telerik team
answered on 23 Feb 2016, 04:35 PM

Hello David,

 

Please refer to the Multiple Filters on datasource that shows how to apply multiple filters to the data source. Also there is an small example to illustrate the approach. 

 

Regards,
Boyan Dimitrov
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
0
David
Top achievements
Rank 1
answered on 24 Feb 2016, 04:45 PM

Thank you for your reply, I clearly stated though that I am not trying to apply filters to the dataSource. I believe you guys keep missing what people are asking you for here. Perhaps it's subtle so please let me reexplain. Please read carefully, I have looked at the multiple KENDO filtering solutions, click select filtering, etc., they are not what we are trying to do here:

 

YOU ARE SAYING: Applying multiple filters to the same search criteria. That is not what we are asking...

WE ARE ASKING: "After" a FILTER has been selected (I know longer want to filter the search criteria) I want to return 1 ROW per search term in the Search Input, based on the already chosen filter. 

EXAMPLE: Filter [dogs]: Search input: [poodle, snauzer, doberman, german sheapard]  - user clicks "search".

Results:  

ROW1  [poodle]

ROW 2 [snauzer]

ROW 3 [doberman]

ROW 4 [german sheapard]

 

Please READ that a second. You are no longer filtering, you are performing a QUERY on multiple search phrases, something your grid does not do. The issue is that your grid will only return a set of rows per 1 single search item. It doesnt return rows for many search items. Many people have asked this question and no one is answering it. Please at least acknowledge the correct question please. I feel my previous code example should have done this but you guys keep bombarding us [we who have asked this question before] with filtering when this has nothing to do with filtering at all.

 

20 Year JS developer. Ask me anything. I will be happy to even post the solution I finally came up with but it is frustrating not to hear that the question is comprehended. My company just started using Kendo, PAY LICENSES, so far I have asked one question that question was not comprehended correctly. If you feel my question has something to do with filtering then please humor me and post how filtering will provide a row of data for each comma delimited search phrase, under 1 single filter.

 

Thank you!

     

 

 

0
Boyan Dimitrov
Telerik team
answered on 26 Feb 2016, 03:24 PM

Hello David,

 

Indeed there was a misunderstanding in our communication and apparently I did not understand your question properly. 

 

Regarding your question you are right that such behavior is not supported by the Kendo UI Grid widget. My initial idea was to apply a couple of filters with logic set to "or" against same column name, but obviously this is not the functionality you are trying to achieve. 

 

However I would strongly suggest to share your ideas for feature requests at Kendo UI UserVoice to allow other users vote for it. Most voted ideas are included in next Kendo UI releases.  

 

Regards,
Boyan Dimitrov
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
0
Jared
Top achievements
Rank 2
answered on 15 Mar 2016, 06:17 PM

[quote]20 Year JS developer. Ask me anything. I will be happy to even post the solution I finally came up with but it is frustrating not to hear that the question is comprehended. My company just started using Kendo, PAY LICENSES, so far I have asked one question that question was not comprehended correctly. If you feel my question has something to do with filtering then please humor me and post how filtering will provide a row of data for each comma delimited search phrase, under 1 single filter.[/quote]

David - if your so smart and have 20 years of JS experience then why are you on a public forum asking for help?  Your comments on this thread remind of the stereotypical "nerdy programmer" that thinks he knows everything because he knows how to write a little code.  It's simply disgusting and if I were Telerik/Kendo I'd give you your money back and rescind your license.  I wish blocking specific users was a common feature of most message boards because I would certainly put it in play here.

Tags
Grid
Asked by
David
Top achievements
Rank 1
Answers by
Boyan Dimitrov
Telerik team
David
Top achievements
Rank 1
Jared
Top achievements
Rank 2
Share this question
or