Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    How to add filed value into column head dropdown as filter?

    For instance, I have a listgrid with "Country" column, there are 2 filed values "Brazil" and "Canada", I want both of them can be shown as column head dropdown list (please attache image), when user click each one, the listgrid can only show the relative value, another words, when user click "Brazil", only "Brazil" can be shown at "Country" column, and "Canada" disappears.

    Is it possible?


    Thanks


    Jason
    Attached Files

    #2
    This is important requirement from my PM, because of lots of screens need to implement it. the ms sharepoint can reach to that, please see the attached file.

    Thanks in advance.


    Jason
    Attached Files

    Comment


      #3
      final ListGrid countryGrid = new ListGrid();

      countryGrid.setLeaveScrollbarGap(true);
      countryGrid.setCanFreezeFields(false);
      countryGrid.setCanGroupBy(false);
      countryGrid.setWidth100();
      countryGrid.setHeight(300);

      countryGrid.setAutoFetchData(true);
      countryGrid.setShowAllRecords(true);
      countryGrid.setSelectionType(SelectionStyle.SIMPLE);
      countryGrid.setSelectionAppearance(SelectionAppearance.CHECKBOX);

      countryGrid.setCanAddFormulaFields(true);
      countryGrid.setCanFreezeFields(true);

      all of them are sealed to code...., it looks that will be difficult for smartgwt.


      Thanks

      Jason

      Comment


        #4
        Have you tried consulting the docs? The APIs involved are all pretty obvious - override getHeaderContextMenuItems(), add your custom items, and call setCriteria().

        Comment


          #5
          There's even a sample of this.

          Comment

          Working...
          X