Results 1 to 4 of 4

Thread: Issue with ListFilter display for remote sorting

  1. #1
    Ext GWT Premium Member
    Join Date
    Oct 2010
    Posts
    193

    Default Issue with ListFilter display for remote sorting

    Using the following versions:
    - GWT 2.6.1
    - GXT 3.1.1

    I have the Companygrid with empName as one of its column. I was trying to add remoterfilter in this column. I want empName(s) to be displayed in the filter's ListMenu and empId(s) to be sent to service for filtering. Here is the code snippet for what I was trying to do.

    Code:
    EmployeeProperties employeeProperties = GWT.create(EmployeeProperties .class);
    
    final ListStore<EmployeeModel> employeeStore= new ListStore<EmployeeModel>(employeeProperties.empId());
    employeeStore.addAll(getEmployees()));
    
    ListFilter<CompanyModel , EmployeeModel> employeeFilter= new ListFilter<CompanyModel , EmployeeModel>(new ValueProvider<CompanyModel , EmployeeModel>() {
    
    @Override
    public EmployeeModel getValue(CompanyModel object) {
    return null;
    }
    
    @Override
    public void setValue(CompanyModel object, EmployeeModel value) {}
    
    @Override
    public String getPath() {
    return "empName";
    }
    }, employeeStore);
    employeeFilter.setUseStoreKeys(true);
    
    GridFilters<CompanyModel > filters = new GridFilters<CompanyModel >(companyLoader);
    filters.initPlugin(grid);
    filters.setLocal(false);
    filters.addFilter(employeeFilter);
    Form the above code I was able to send empId(s) that are selected in the filter to the server, but am facing difficulties in displaying the empName in the filter's ListMenu. I remember the earlier versions of GXT had listFilter.setDisplayProperty() but that is missing in GXT 3.x. So is there any alternate for this now ? I just want to know how to display empName in ListMenu.

    Any help is much appreciated.

  2. #2
    Ext GWT Premium Member
    Join Date
    Oct 2010
    Posts
    193

    Default

    Any one got a chance to look into this ??

  3. #3
    Sencha User
    Join Date
    Jul 2011
    Location
    Germany
    Posts
    223

    Default

    You've got to pimp the ValueProvider applied to ListFilter.

  4. #4
    Ext GWT Premium Member
    Join Date
    Oct 2010
    Posts
    193

    Default

    Hi ,

    I tried setting EmployeeModel in the valueProvider as below

    Code:
     ListFilter<CompanyModel, EmployeeModel> employeeFilter = new ListFilter<CompanyModel, EmployeeModel>(new ValueProvider<CompanyModel, EmployeeModel>() {
        @Override
        public EmployeeModel getValue(CompanyModel compModel) {
          EmployeeModel eModel = getNewEmpModel();
          eModel.setEmpName(compModel.getEmpName());
          eModel.setEmpId(compModel.getEmpId());
          return eModel;
        }
    
    
        @Override
        public void setValue(CompanyModel compModel, EmployeeModel eModel) {
          compModel.setEmpName(eModel.getEmpName());
          compModel.setEmpId(eModel.getEmpId());
        }
    
    
        @Override
        public String getPath() {
          return "empName";
        }
      }, employeeStore);
    Not sure what I am missing here, Any help much appreciated.

Similar Threads

  1. [NOREPRO] Grid - remote sorting issue on safari only
    By bawan in forum Sencha GXT Bugs
    Replies: 3
    Last Post: 11 Sep 2013, 7:18 AM
  2. Replies: 6
    Last Post: 2 Mar 2013, 11:16 AM
  3. ListFilter and remote store- never loads?
    By heratech in forum Ext:Bugs
    Replies: 1
    Last Post: 9 Jun 2011, 10:31 AM
  4. Remote Sorting Issue with IE
    By akothari in forum Ext 2.x: Help & Discussion
    Replies: 2
    Last Post: 16 Mar 2010, 6:58 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •