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

  • Home
  • SEARCH
  • 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 8842771
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T11:02:55+00:00 2026-06-14T11:02:55+00:00

I have a Slider model having some associated Images (models). When editing a Slider,

  • 0

grid filtering and checkboxes

I have a Slider model having some associated Images (models). When editing a Slider, there’s a tab for its images. Now this can be modified, to select and deselect containing images. This, it seems, is done through an admin grid, having a checkbox column (the “values” key is for testing):

    $this->addColumn('in_slider', array(
        'header_css_class' => 'a-center',
        'type'      => 'checkbox',
        'name'      => 'in_slider',
        'values'    => array(1,2),
        'align'     => 'center',
        'index'     => 'slider_image_id'
    ));

Let’s say the Slider in the above image has one image attached, and that works fine. But, when user selects “Any” and clicks “Search”, all images must show, but those that are not associated should be deselected. I think this is standard behavior for such a feature.

What I don’t get is the mechanism behind those two buttons: Reset Filter and Search. From what I’ve managed to dig up, a grid class has a getGridUrl() method which is used to refresh the grid data (via AJAX). That URL mapping to a controller.

// in grid class
public function getGridUrl()
{
    return $this->getUrl('*/*/editGrid', array('_current' => true));
}

// Image controller
public function editGridAction()
{
    $blockMarkup = $this->getLayout()->createBlock('module/someblock')->toHtml();
    $this->getResponse()->setBody($blockMarkup);
}

But what about the “Search” button? How does that work?

How do other modules know when to show ALL entities, or searching for “Yes” or “No”?

When saving the slider, how can one grab the selected values? Working in Slider controller’s saveAction I presume, but how do you get the checkbox values?

  • 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-06-14T11:02:57+00:00Added an answer on June 14, 2026 at 11:02 am

    What you’re looking for is a mass action. Add this function to your grid file (whatever extends Mage_Adminhtml_Block_Weidget_Grid):

    protected function _prepareMassaction()
    {
      $this->setMassactionIdField('some_ID');
      $this->getMassactionBlock()->setFormFieldName('element_name');  //html name of checkbox
      $this->getMassactionBlock()->addItem('some_ID', array(
        'label'=> __('Some Label'),
        'url'  => $this->getUrl('*/*/doSomething'),   //an action defined in the controller
        'selected' => 'selected',
        'confirm' => __('Are you sure?')
      ));
    
      return $this;
    }
    

    Here’s a good blog post that helps to explain the concept:
    http://inchoo.net/ecommerce/magento/how-to-add-massactions-to-magentos-grid/

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

Sidebar

Related Questions

I have a slider and want to change its value in some function. I
I have the following model associations: class Slider < ActiveRecord::Base has_one :featured_happening, :as =>
I have a slider I made: http://dranz1r.com/index.html When you slide right for example, there
I have a slider with 3 slides - Intro, Question, Submit. Now I want
This slider is possessed: Slider http://gorgando.com/possessedSlider.jpg Whenever I enter editing mode for the tableview
I have a few models I'm trying to relate. One model is Item ,
Can someone please clarify the following; if a have the following model; presentation-->slide-->video where
Im having a problem, I have managed to get some code to make a
I am using jquery Mobile 1.0. I have this html code. <label for=slider class=ui-hidden-accessible>
I'm trying to model my app and I've come across this problem: I have

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.