Announcement

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

    ListGrid fetch called when setDataSource() is called

    I have a listgrid with a filter editor showing. Whenever I change the datasource (setDataSource()) the grid is doing a fetchData() (or maybe a filterData()).

    Here is the grid;

    Code:
    isc.ListGrid.create({
    	autoFetchData: false,
    	showFilterEditor: true,
    	fields: [{name: "dummy"}]});
    Any thoughts as to why the grid is doing a fetch/filter when the dataSource is reset? Is there any way to suppress this behavior?

    Thanks,
    -p

    #2
    Here is a sample datasource that is being set. Notice the displayField(s) in the field definitions.

    Code:
    <DataSource
        ID="ProteinDS"
        serverType="generic"
    >
        <fields>
             <field name="id" title="id" type="text" isIdentity="false" length="36"  hidden="true" primaryKey="true" />
              <field name="sampleProperties" title="sample properties" type="text" isIdentity="false" displayField="samplePropertiesName"  metatype="SampleProperties" />
            <field name="samplePropertiesName" title="sample properties name" type="text" hidden="true"  />
            <field name="supplier" title="supplier" type="text" isIdentity="false" displayField="supplierName"  metatype="Supplier" />
            <field name="supplierName" title="supplier name" type="text" hidden="true"  />
            <field name="dataSource" title="data source" type="text" isIdentity="false" required="true" displayField="dataSourceName"  metatype="DataSource" />
            <field name="dataSourceName" title="data source name" type="text" hidden="true"  />
         </fields>
        <serverObject ID="genericObjectHandler" lookupStyle="new" className="com.lsmgen.port.shared.dmi.GenericObjectDMI"/>
    </DataSource>

    Comment


      #3
      From a quick check (eg Pattern Reuse sample under Featured, remove filterData() call), setDataSource() does not, on it's own, trigger a new fetch. Can you isolate the problem further?

      Comment


        #4
        I've isolated the problem down to the use of the filter editor. If I remove the filter editor the problem goes away. With the filterEditor showing (even if I set it manually using setShowFilterEditor) the problem comes back. autoFetchData is always false.

        -p

        Comment


          #5
          Returning again to the Pattern Reuse sample, enabling the FilterEditor is still not enough to cause an automatic fetch.

          You don't show an optionDataSource in your .ds.xml, but if you had one, that could explain this behavior if you had set autoFetchData on a SelectItem or ComboBoxItem, causing the available options to be fetched in advance.

          You can look at the RPC tab to see what component has initiated the fetch.

          Comment

          Working...
          X