Announcement

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

  • ListGrid Filter Issue

    Hi,
    We recently upgraded to Smart-GWT v12 from v5.1. However, for a ListGrid we're facing issues in the filter column- the filter is non-responsive to the initial key presses in lower-case, but works fine for key presses in the Upper Case. I also noticed that when typing texts in the filter column in lower-case when I press enter it picks up the filter which I don't need for the Uppercase letters. Can someone please help me with this issue?

    Regards,
    Mayank.
    Attached Files

  • #2
    There's very little we can do with such a vague report.

    Only thing we can guess: perhaps you've built your filtering logic so that it is case sensitive, and the previous version automatically uppercased all input characters, but this is no longer working?

    If so, you need to look at the code that was attempting to uppercase inputs. It was probably done in an unsupported way which happened to work anyway, but shouldn't have, and no longer does.

    Comment


    • #3
      We're not using any filtering logic, Data Fetch is happening through Filter Data.
      Here is the field Definition

      Code:
      ListGridField newField = new ListGridField(attributeName, record.getAttribute("DisplayName"));
      String promptStr = ClientStringUtil.isNullOrEmpty(toolTip) ? record.getAttribute("DisplayName") : toolTip;
      newField.setPrompt(promptStr);
      newField.setAlign(Alignment.LEFT);
      newField.setCellAlign(Alignment.LEFT);
      if (exportFormat != null)
      {
                          newField.setExportFormat(exportFormat);
       }
      newField.setShowGroupSummary(true);
      newField.setShowGridSummary(false);
      
      boolean visible = record.getAttribute("Visible") != null && "true".equals(record.getAttribute("Visible"));
      newField.setHidden(!visible);
      
      newField.setSummaryFunction(new SummaryFunction()
                              {
                                  @Override
                                  public Object getSummaryValue(Record[] records, ListGridField field)
                                  {
                                      // Use the value of the last tag request for the group
                                      // summary header.
                                      if (ClientStringUtil.isNullOrEmpty(records[0].getAttributeAsString(attributeName)))
                                      {
                                          return "";
                                      }
                                      else
                                      {
                                          if (field.getType() == ListGridFieldType.INTEGER)
                                          {
                                              return records[0].getAttributeAsInt(attributeName);
                                          }
                                          else if (field.getType() == ListGridFieldType.FLOAT)
                                          {
                                              return records[0].getAttributeAsDouble(attributeName);
                                          }
                                          else if (field.getType() == ListGridFieldType.DATE)
                                          {
                                              return records[0].getAttributeAsDate(attributeName);
                                          }
                                          else if (field.getType() == ListGridFieldType.DATETIME)
                                          {
                                              return records[0].getAttributeAsDate(attributeName);
                                          }
                                          else if (field.getType() == ListGridFieldType.BOOLEAN)
                                          {
                                              return records[0].getAttributeAsBoolean(attributeName);
                                          }
                                          return records[0].getAttributeAsString(attributeName);
                                      }
                                  }
                              });
      
      
                      tagRequestGrid.filterData(currentCriteria, new DSCallback()
                      {
                          @Override
                          public void execute(DSResponse dsResponse, Object data, DSRequest dsRequest)
                          {
                              // Get the data returned from the backend
                              if (dsResponse.getStatus() == DSResponse.STATUS_SUCCESS)
                              {
                                  if (dsResponse.getData() != null && dsResponse.getData().length > 0)
                                  {
                                      // Keep track of the records returned by the
                                      // backend. This will be useful for getting the
                                      // values of hidden fields (such as Draft or
                                      // Tag, for example), amongst other things.
                                      latestRecords = dsResponse.getData();
                                  }
                              }
      
                              // tagRequestGrid.setFilterLocalData(true);
      
                              if (dsResponse.getStatus() != 0)
                              {
                                  currentCriteria = getCriteria(filter);
                              }
                              tagRequestGrid.setCriteria(currentCriteria);
      
                              ListGridField dealsCountField = tagRequestGrid.getField(RequestSummaryFieldName.DEAL_COUNT.toString());
                              if (dealsCountField != null)
                              {
                                  dealsCountField.setCellAlign(Alignment.CENTER);
                              }
      
                              tagRequestGrid.ungroup();
                              tagRequestGrid.hideFields(requestFields, false);
                              tagRequestGrid.showField(RequestSummaryFieldName.TAG_CODE.toString());
                              // Set the formatting for certain fields, such
                              // as Tag Code, Edit Tag, and Tag Notes.
                              setupFieldFormatting(DataType.Tags);
      
                              if (callback != null)
                              {
                                  callback.execute(true);
                              }
                          }
                      }); // End filterData

      Comment


      • #4
        What do you mean by "non-responsive" - no fetch occurs?

        One problem here is that you are inexplicably applying the criteria to the grid right after filtering has occurred. Why would you do that? That would generally wipe out any changes in criteria that occurred during the fetch, which could be your problem.

        Comment

        Working...
        X