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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T10:32:20+00:00 2026-05-26T10:32:20+00:00

If you create a custom DataSource in SmartGWT, is it possible to remove a

  • 0

If you create a custom DataSource in SmartGWT, is it possible to remove a field filter instead of hiding it entirely from the grid columns?

As seen here:

enter image description here

The Country code field exists, but is hidden in the above image.

Clarification: I want to hide the Country code field at the start, but still have it visible in the Columns context menu. If you use setHidden(true) the field disappears from the Columns menu above.

Example code:

public class MyDataSource extends DataSource {

    public MyDataSource() {
        DataSourceField countryField = new DataSourceIntegerField("country", "Country code");
        // TODO Find a method that disables the filter, aka hides but not removes the field from the grid.
        countryField.setHidden(true); // Completely hides/removes the field, not desireable.
        countryField.setCanFilter(true); // Doesn't seem to change anything. 
        addField(countryField);

        // Other fields...
    }

}

How would this be achieved in a ListGrid with the above DataSource?

  • 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-26T10:32:21+00:00Added an answer on May 26, 2026 at 10:32 am

    I’m not sure if I fully understood the question.

    Are you looking for a way to hide the “Country code” option from the Columns context menu? You can do that by declaring
    ListGridField.setCanHide(false) to the corresponding ListGridField.

    ListGridField countryCode = new ListGridField("countryCode");
    countryCode.setHidden(true);
    countryCode.setCanHide(false); // won't be shown in the context menu
    

    Or, are you trying to disable filtering?

    If so, does the user have to have the option to see the country code column in some cases?
    If not, you can just leave the MyDataSource as it is and define only those ListGridFields that you want the user to see.

    ListGrid grid = new ListGrid();
    ListGridField country = new ListGridField("country");
    ListGridField capital = new ListGridField("capital");
    ListGridField continent = new ListGridField("continent");
    // no countryCode here
    grid.setFields(country, capital, continent);
    

    The underlying country code attribute is still available in the code, eg. via record.getAttribute("countryCode");, it’s just not shown in the ListGrid.

    Alternatively, you can define the filtering on grid level with ListGridField.canFilter(Boolean canFilter).

    ListGridField countryCode = new ListGridField("countryCode ");
    countryCode.setCanFilter(false);
    

    EDIT:

    So, don’t set the hidden attribute in the datasource, but instead directly to the ListGridField.

    DataSource

    public class MyDataSource extends DataSource {
    
      public MyDataSource() {
        DataSourceField countryCode = new DataSourceStringField("countryCode", "Country code");
        DataSourceField country = new DataSourceStringField("country", "Country");
        DataSourceField capital = new DataSourceStringField("capital", "Capital");
        DataSourceField continent = new DataSourceStringField("continent", "Continent");
    
        setFields(countryCode, country, capital, continent);
      }
    }
    

    ListGrid

    ListGrid grid = new ListGrid();
    ListGridField countryCode = new ListGridField("countryCode");
    countryCode.setHidden(true);
    countryCode.setCanHide(true); // I don't think this is even necessary.
    ListGridField country = new ListGridField("country");
    ListGridField capital = new ListGridField("capital");
    ListGridField continent = new ListGridField("continent");
    grid.setFields(countryCode, country, capital, continent);
    

    That should do the trick.

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

Sidebar

Related Questions

I need create custom dialog and put JPanel into it. Is it possible?
I use a TcxExtLookupComboBox from Devexpress and try to implement a custom datasource. I
I am trying to create a custom datasource control. I have been following this
Our shop designs and create custom software applications for a vareity of vertical industies.
How to create Custom shaped buttons in c#: say triangular
Can i create custom touch events for iPhone?? will the device support for creating
I think I know how to create custom encrypted RSA keys, but how can
Why do we need to create custom exceptions in .NET?
Is this the only way to create custom model validation? To do it using
What is the right way to create custom pgsql types for django application so

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.