We have some datasources that have a very large number of fields. We will have both a ListGrid and a DynamicForm linked to these datasources. We would like the ListGrid to only show a few select fields from the datasource and the DynamicForm to show all fields. We are currently marking fields that we don't want displayed with detail=true in the datasource and setting the ListGrid.showDetailFields to false. We would like to avoid this however since it requires setting the detail flag on a large number of fields in the datasource. Can we set up which fields from the datasource should be displayed in the ListGrid in the component's defaults?
For example:
The ListGrid below should only show the contract_no and contract_yr fields from the datasource. I know that the fields definition does not work as written. How would I set the contractGrid defaults to only show these two fields from the datasource?
/* CODE */
contractGridDefaults: {
_constructor: isc.ListGrid,
width: "100%",
height: "300",
minHeight: "125",
margin: 5,
showResizeBar: true,
autoParent: "panelCanvas",
autoFitFieldWidths: true,
autoFitWidthApproach: "both",
showFilterEditor: true,
fields: [
{name="contract_no"},
{name="contract_yr"}
]
}
/* DATASOURCE */
<DataSource
ID="rscReacctContracts"
serverType="sql"
>
<fields>
<field name="contract_id" type="integer" title="ContractID" primaryKey="true" hidden="true" />
<field name="contract_no" type="text" length="100" title="ContractNo" />
<field name="contract_yr" type="integer" title="ContractYear" format="###0" />
<field name="reins_prog" type="text" length="200" title="ContractName" />
<field name="participation_type" type="text" length="20" title="TypeCode" detail="true" />
<field name="eff_date" type="date" title="Effective" useTextField="true" />
</fields>
</DataSource>
Thanks!
For example:
The ListGrid below should only show the contract_no and contract_yr fields from the datasource. I know that the fields definition does not work as written. How would I set the contractGrid defaults to only show these two fields from the datasource?
/* CODE */
contractGridDefaults: {
_constructor: isc.ListGrid,
width: "100%",
height: "300",
minHeight: "125",
margin: 5,
showResizeBar: true,
autoParent: "panelCanvas",
autoFitFieldWidths: true,
autoFitWidthApproach: "both",
showFilterEditor: true,
fields: [
{name="contract_no"},
{name="contract_yr"}
]
}
/* DATASOURCE */
<DataSource
ID="rscReacctContracts"
serverType="sql"
>
<fields>
<field name="contract_id" type="integer" title="ContractID" primaryKey="true" hidden="true" />
<field name="contract_no" type="text" length="100" title="ContractNo" />
<field name="contract_yr" type="integer" title="ContractYear" format="###0" />
<field name="reins_prog" type="text" length="200" title="ContractName" />
<field name="participation_type" type="text" length="20" title="TypeCode" detail="true" />
<field name="eff_date" type="date" title="Effective" useTextField="true" />
</fields>
</DataSource>
Thanks!
Comment