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 8283063
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T10:36:07+00:00 2026-06-08T10:36:07+00:00

I have a grouped Checkbox , and it has 4 checkboxes in it. When

  • 0

I have a grouped Checkbox, and it has 4 checkboxes in it.

When the user selects a checkbox I need to filter a data store based on the value of the text box. When i select 2 textboxes, I get the output of ["Albert","Francis"], and when I select only the 1st textbox I get ["Albert"] and so forth.

Now, i need to know how to filter this ?

onCheckBoxGroupChange : function (field,newValue,oldValue,options) {
var chkv=newValue.chb;
console.log (chkv);
var st= Ext.getStore('People'); 
        st.on('load', function() {
           st.filter({
               filterFn: function(rec) {                   
                   return rec.get('name') == chkv; 

The problem I am having is, when I select both the CheckBoxes, chkv becomes ["Albert","Francis"] (Like an array), therefore I am unable to return the value since rec.get('name') == chkv; doesn’t look for an array.

Can someone help me?

  • 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-08T10:36:08+00:00Added an answer on June 8, 2026 at 10:36 am

    what about:

    filterFn: function(rec) {
        return Ext.Array.contains(chkv, rec.get('name'));
    }
    

    I want to make sure you know that you do not have to reload the store if you want to filter it. It looks like that is what you are doing in the snippet you provided above.

    There are other problems actually, what your onCheckBoxGroupChange handler will actually do (if you leave it the way you have it above), is the following:

    Every time a user clicks a checkbox it will first reload the store from the server, and then add the selected filter to the store’s filters and then filter the store by the filters it has saved.

    E.g.:

    User clicks “Albert” checkbox

    Store reloads 
    Store adds `["Albert"]` filter function 
    Store performs filtering with `["Albert"]` filter function
    

    User clicks “Francis” checkbox

    Store reloads
    Store adds `["Albert", "Francis"]` filter function
    Store performs filtering with `["Albert"]` filter function
    Store performs filtering with `["Albert", "Francis"]` filter function
    

    User unclicks “Albert” checkbox

    Store reloads
    Store adds `["Francis"]` filter function
    Store performs filtering with `["Albert"]` filter function
    Store performs filtering with `["Albert", "Francis"]` filter function
    Store performs filtering with `["Francis"]` filter function
    

    You would just progressively get more and more filters. Plus unnecessarily reloading the store many times. I don’t think that is what you are going for.

    You should review the docs on datastore filtering for more data on how to go about this.

    Also, in your question you said that you had this problem when you selected two checkboxes because it returned an array. According to the text of your question you are also getting an array when you select one checkbox (["Albert"]). It only has one item in it but it is an array.

    That is why my solution (which requires your chkv variable to be an array) would work.

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

Sidebar

Related Questions

I have a grouped query, and would like to filter it based on count(*)
I have a data grid, grouped based on employee name. I am able to
I have multiple input text fields grouped in divs: <div class=container0> <input class=containerItem0 name=containerItem[0][0]
I have grouped some checkbox in GroupBox1, 2, 3 respectively. Now I want to
I have a grouped UITableView that has 3 sections. I would like to show
I have a grouped tableview that is populated with XML data in one section.
I have a grouped table retrieved using CoreData. The sections are based on a
Ive got ths really annoying issue I have grouped a set of data and
I have a grouped UITableView . It has 7 rows. I wanted a transparent
I have a grouped uitableview which has several sections. The sections are showing up

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.