Announcement

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

    grid.filterEditor bug when criteria contains field not present in select clause

    SmartClient Version: SNAPSHOT_v11.1d_2017-05-01/Enterprise Deployment (built 2017-05-01)

    Chrome on OSX

    Hello, please modify the supplyItem dataSource like this:

    Code:
    <DataSource
        ID="supplyItem"
        serverType="sql"
        tableName="supplyItem"
        titleField="itemName"
        testFileName="/examples/shared/ds/test_data/supplyItem.data.xml"
        dbImportFileName="/examples/shared/ds/test_data/supplyItemLarge.data.xml"
    >
         <fields>
            <field name="itemID"      type="sequence" hidden="true"       primaryKey="true"/>
            <field name="itemName"    type="text"     title="Item"        length="128"       required="true"/>
            <field name="SKU"         type="text"     title="SKU"         length="10"        required="true"/>
            <field name="description" type="text"     title="Description" length="2000"/>
            <field name="category"    type="text"     title="Category"    length="128"       required="true"
                   foreignKey="supplyCategory.categoryName"/>
            
            <field name="unitCost"    type="float"    title="Unit Cost"   required="true">
                
    
            </field>
            <field name="nextShipment"  type="date" title="Next Shipment" />
    
        </fields>
        <operationBindings>
          <operationBinding operationType="fetch" outputs="itemID,nextShipment,description" >
          </operationBinding>
     </operationBindings>
    </DataSource>
    as you may see there's an outputs attribute which limits the returned columns (the problem is reproducible also using a groupBy with the same fields).

    then run this test case:
    Code:
    isc.ListGrid.create({
        ID: "supplyList",
        width:500, height:300, alternateRecordStyles:true,
        dataSource: supplyItem,
        fields:[
            {name:"description"}
        ],
        autoFetchData: false,
        showFilterEditor: true,
        filterOnKeypress: true
    });
    
    supplyList.fetchData({category:"Pastes and Gum"});
    Where you may see that there's a fetch which uses a field not included in 'outputs'.
    If you try to filter, you'll see that:
    - there's always a fetch when you type the first character in the filter editor (even if the records are in the local cache)
    - when you type the 2nd character, matching or not, all records disappear.
    - when you delete the value, the records are re-fetched.
    - if you re-type anything in the filter editor, the records disappear, and they won't show even if you delete the value in the filter editor (there are no more fetches)

    #2
    What you've done here is returned records that will never match the applied criteria when local filtering occurs, but you've left local filtering on.

    Either disable local filtering or return records that match the criteria.

    Comment


      #3
      thanks for the heads up.
      Actually if I use an implicitCriteria, it works. Is it expected? May I rely on this?

      Comment

      Working...
      X