Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6861297
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T02:31:01+00:00 2026-05-27T02:31:01+00:00

i try to populate a dropdown menu for quicksearch in mvcgrid my code is:

  • 0

i try to populate a dropdown menu for quicksearch in mvcgrid my code is:

 $g = $this->add('MVCGrid');
 $g->setModel('materiale');
 $g->addPaginator(25);
 $s = $g->addQuickSearch(array('nome_mat'));

 $value_list = array(
        1=>'Granito',
        2=>'Marmo'
    );

 $s->addField('dropdown','tipo_mat','Tipo_mat: ')->setValueList($value_list);

The dropdown list appear on quick search form.
My db field is tipo_mat, but when i click quicksearch button nothing uppens, can someone help me plase.
Thank’s

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T02:31:02+00:00Added an answer on May 27, 2026 at 2:31 am

    You will find that the Quicksearch is nothing more that a simple form, which applies condition to your grid when submitted. In theory, you could have a standard form sitting in there doing the same thing:

    $search = $g->add('Form',null,'quick_search',array('form/quicksearch','form'));
    $search->addFiled('dropdown','tipo_mat')
        ->setValueList($value_list)
        ->set($_GET['tipo_mat']);
    $search->addField('search','q')
        ->set($_GET['q']);
    
    // Handle submit of form, reload grid with AjAX, pass values as arguments
    if($search->isSubmitted()){
        $grid->js()->reload($search->getAllData())->execute();
    }
    
    // If values are passed, use them
    if($_GET['q'])
        $grid->dq->where('name like','%'.$_GET['q'].'%');
    
    if($_GET['tipo_mat'])
        $grid->dq->where('foo',$_GET['tipo_mat']);
    

    The “Filter” and “QuickSearch” classes help you with saving search values but you must not be afraid to look into their source and create your own QuickSearch class which can apply parameters properly.

    Perhaps using Filter in your case is better than quick search, because of how “applyDQ” is handled:

    https://github.com/atk4/atk4/blob/master/lib/Filter.php#L62

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am using following code to populate DropDown: $(document).ready(function(){ $('#inDistrict').sSelect(); $(#inDistrict).change(function(){ $.getJSON(filldistricts.php,{id: $(this).val(), ajax:
I'm trying to dynamically populate a dropdown when a user is trying to add
I'm creating a SelectList to populate a dropdown list from a LINQ query. This
Try loading this normal .jpg file in Internet Explorer 6.0. I get an error
Try the following code public enum Color { Blue=1, Red=2, Green=3 } public List<Color>
This should be so much simpler! I have an array of JSON objects that
I'm using the following chunks of code to populate a drop down box on
I've got a dropdown on my index.xhtml JSF front page. The associated code/commandButton looks
.Hi everyone i need a little help for my dropdown menu. .I already know
.hey guys how can i populate a dropdown list with the list of tables

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.