Announcement

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

    DataSource.implicitCriteria not enforced after ListGrid.updateData

    SmartClient Version: SNAPSHOT_v12.1d_2019-03-27/EVAL Development Only (expires 2019.05.26_07.12.07) Licensed to: Isomorphic Software (#ISC_EVAL_NIGHTLY)

    Chrome on OSX

    Hello, please try this test case (I've modified the databoundFetch sample):

    Code:
    isc.ListGrid.create({
        ID: "countryList",
        width:500, height:224, alternateRecordStyles:true,
        dataSource: worldDS,
        // display a subset of fields from the datasource
        fields:[
            {name:"countryCode"},
            {name:"countryName"},
            {name:"capital"},
            {name:"continent"}
        ],
        autoFetchData:true
    })
    
    isc.IButton.create({
        title:"update", top:250,
        click:function(){
            countryList.updateData({
                pk:42, capital:"AganaFoo"
            })
        }
    })
    In the dataSource I've added an implicitCriteria:

    Code:
    <DataSource
        ID="worldDS"
        serverType="sql"
        recordName="country"
        testFileName="/examples/shared/ds/test_data/world.data.xml"
    >
        <implicitCriteria operator="and" _constructor="AdvancedCriteria">
             <Criterion fieldName="capital" operator="equals">
                 <value>Agana</value>
             </Criterion>
        </implicitCriteria>
        <fields>
            <field name="pk"            type="integer"    hidden="true"            primaryKey="true" />
            <field name="countryCode"   type="text"       title="Code"             required="true"   />
            <field name="countryName"   type="text"       title="Country"          required="true"   />
            <field name="capital"       type="text"       title="Capital"          />
            <field name="government"    type="text"       title="Government"       length="500"      />
            <field name="continent"     type="text"       title="Continent"        >
                <valueMap>
                    <value>Europe</value>
                    <value>Asia</value>
                    <value>North America</value>
                    <value>Australia/Oceania</value>
                    <value>South America</value>
                    <value>Africa</value>
                </valueMap>
            </field>
            <field name="independence"  type="date"       title="Nationhood"          />
            <field name="area"          type="float"      title="Area (km&amp;sup2;)" format=",0" />
            <field name="population"    type="integer"    title="Population"          format=",0" />
            <field name="gdp"           type="float"      title="GDP ($M)"            format=",0" />
            <field name="member_g8"     type="boolean"    title="Member"                  />
        </fields>
    </DataSource>
    When you click the 'update' button, you'll see that the record is updated, and it doesn't get removed from the grid's resultSet.

    It does work if the implicitCriteria is set on the ListGrid. But I think it must work in both cases, am I wrong?

    #2
    same behaviour with
    SmartClient Version: v11.1p_2019-03-27/Enterprise Development Only (built 2019-03-27)

    Comment


      #3
      This is expected behavior - dataSource.implicitCriteria is documented to limit fetches, and would not be involved in cache sync behavior in the grid or ResultSet. There are separate implicitCriteria properties on each for this reason.

      Comment

      Working...
      X