I have a listgrid initially set to paged. Our clients want to be able to select all records and perform certain actions such as delete on them. I dynamically set showAllRecords and dataFetchMode and invalidateCache then in dataArrived I attempt to selectAllRecords but I still get the popup saying I should work with smaller batches which I thought would go away once I have all the data in the fetched - am I doing something wrong? Is there another approach I should be taking?
DS
Code:
isc.ListGrid.create({ ID: "countryList", width:500, height:224, alternateRecordStyles:true, dataSource: worldDS,autoFetchData:true, // display a subset of fields from the datasource fields:[ {name:"countryCode"}, {name:"countryName"}, {name:"capital"}, {name:"continent"} ], sortFieldNum: 1, // sort by countryName dataArrived: function(startRow,endRow){ if(countryList.$cwSelectAll){ countryList.selectAllRecords(); } countryList.$cwSelectAll = null; } }) isc.Button.create({ top:300, title: "Select All", click: function(){ countryList.setProperties("dataFetchMode", "basic"); countryList.setProperties("showAllRecords", true); countryList.invalidateCache(); countryList.$cwSelectAll = true; } })
Code:
<DataSource ID="worldDS" serverType="sql" recordName="country" testFileName="/examples/shared/ds/test_data/world.data.xml" > <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&sup2;)" /> <field name="population" type="integer" title="Population" /> <field name="gdp" type="float" title="GDP ($M)" /> <field name="member_g8" type="boolean" title="G8" /> </fields> </DataSource>
Comment