Announcement

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

    Decimal value in FilterBuilder

    Hello,

    I am using FilterBuilder for ListGrid.

    One of my field is float type. When I try to filter with operation Greater Than or Less Thank with a interger no. (e.g. 10). It returns no result. I have to enter 10.1.

    I tried to enter 10.0 but it rounds it up to 10 automatically.

    How to solve this problem?

    Thank you.

    #2
    Hello bobotam,

    Most likely this request is going to your DataSource, and the DataSource is not handling the criteria correctly. You would need to share many more details before we can say for sure.

    Comment


      #3
      Here is my code:

      final FilterBuilder filterBuilder = new FilterBuilder();
      filterBuilder.setDataSource(DataSource.get("STOCK_INFO"));
      IButton filterButton = new IButton("Filter");
      filterButton.addClickHandler(new com.smartgwt.client.widgets.events.ClickHandler() {
      public void onClick(com.smartgwt.client.widgets.events.ClickEvent event) {
      grid.invalidateCache();
      grid.filterData(filterBuilder.getCriteria());
      }
      });


      DataSource:
      <fields>
      <field primaryKey="true" name="STOCK_CODE" length="100" type="text" width="100"></field>
      .................
      <field name="PRICE_CASH" type="float" width="100" title="Price Cash per Share" emptyCellValue="---" ></field>
      <field name="PRICE_EARNINGS" type="float" width="100" title="Price Earnings Ratio(X)" emptyCellValue="---" ></field>
      ............


      The filterCriteria was set to PRICE_CASH or PRICE_EARNINGS.

      Please advice. Thanks.

      Comment


        #4
        So obviously this question still cannot be answered, since we don't know what kind of DataSource that is - SQL? Hibernate? Custom code?

        Comment


          #5
          yes, it is SQL:

          <DataSource
          dbName="Oracle"
          tableName="STOCK_INFO"
          ID="STOCK_INFO"
          serverType="sql"

          Comment


            #6
            Any follow up on this? - I have exactly the same problem

            Comment

            Working...
            X