⚠ In case you've missed it, we have migrated to our new website, with a brand new forum. For more details about the migration you can read our blog post for website migration. This is an archived forum. ⚠

  •     

profile picture

Remove unwanted column name from Search list filters on drop down



hariprasath
  • profile picture
  • Member

Posted 08 July 2013 - 05:51 AM

Hi,

i need help to remove/hide the columns from search dropdown

$crud->columns('name','challenge_type','weeks','amount','priority','images','challengecolor','move_up_down','status');


here i dont want following columns in search(images, move_up_down), and this field are only for display name i dont want this in search list, please help me here,

Thanks in advance

Hari
 

 


goFrendiAsgard
  • profile picture
  • Member

Posted 08 July 2013 - 06:53 AM

maybe using this : http://www.grocerycrud.com/documentation/options_functions/columns


hariprasath
  • profile picture
  • Member

Posted 08 July 2013 - 07:37 AM

Hi goFrendiAsgard,

Thanks for the replay.

And what i want do is,

$crud->columns('name','challenge_type','weeks','amount','priority','images','challengecolor','move_up_down','status');

i have search drop down in that i dont want to the following to do search

images
move_up_down

Thanks

 


hariprasath
  • profile picture
  • Member

Posted 08 July 2013 - 07:38 AM

Hi goFrendiAsgard,

Thanks for the replay.

And what i want do is,

$crud->columns('name','challenge_type','weeks','amount','priority','images','challengecolor','move_up_down','status');

i have search drop down in that i dont want to the following to do search

images
move_up_down

Thanks

 


Amit Shah
  • profile picture
  • Member

Posted 08 July 2013 - 19:18 PM

Well.. i will recommend that you write your custom script and add it to grocery crud using set_js function call. In that, under window.ready function, you can write a script to eliminate the undesired values from the dropdown. Thats the easiest way for the same.


hariprasath
  • profile picture
  • Member

Posted 09 July 2013 - 04:15 AM

hi  Amit Shah

Thanks for the Reply, i will do that, i solved the problem.

 

Here the code

 

 $(document).ready(function(){
                            $("ab").each(function(i){
                                var titulo = $(this).attr("title");
                                if(titulo=='Add'){
                                    $(this).attr('href', '<?php echo base_url(); ?>['yourfolder']/['your controller name']/');
                                }
                            });
                                                    
                                                    
                                               var sel = $("select#search_field");
                                               sel.find("option[value='images']").remove();     
                                                    
                        });

 

Thanks

Hariprasath


Amit Shah
  • profile picture
  • Member

Posted 09 July 2013 - 20:27 PM

great job.. good share!!


Phpgeek Saintek Uin
  • profile picture
  • Member

Posted 14 November 2014 - 04:19 AM

how we can add column name on drop down search list filters? I want to add column that not listed at list view. That column are exist in my table.


edy.widodo
  • profile picture
  • Member

Posted 23 February 2019 - 15:24 PM

hi  Amit Shah

Thanks for the Reply, i will do that, i solved the problem.

 

Here the code

 

 $(document).ready(function(){
                            $("ab").each(function(i){
                                var titulo = $(this).attr("title");
                                if(titulo=='Add'){
                                    $(this).attr('href', '<?php echo base_url(); ?>['yourfolder']/['your controller name']/');
                                }
                            });
                                                    
                                                    
                                               var sel = $("select#search_field");
                                               sel.find("option[value='images']").remove();     
                                                    
                        });

 

Thanks

Hariprasath

 

 

Hi @hariprasath,

 

can you tell me which file to be edit ???

 

Thanks,

 

Edy