Adobe 告诉我们不要在移动设备上使用Datagrid 。我正在创建一个 Blackberry Playbook 应用程序,它有更多的屏幕空间来显示数据表。所以出现了几个问题!
如果我不应该使用 DataGrid,我应该使用什么?(列表不计算在内,因为在我的应用程序中,我有 10 个表,每个表都有不同的列数和列宽)
好的,如果我必须使用 Datagrid,如何设置它的大小以准确显示所有数据?例如,有些表有不同长度的行,所以requestedRowCount='-1'似乎不起作用(参见下面的示例)
编码
<s:DataGrid requestedRowCount="-1" requestedColumnCount="-1" variableRowHeight="true" styleName="dataGrid" id="partiesGrid" dataProvider="{arr1}" skinClass="skins.DataGridSkin" click="navigator.pushView(view.AssessmentInvolvementEditView)">
<s:columns>
<s:ArrayList>
<s:GridColumn dataField="name" headerText="Name" width="150"/>
<s:GridColumn dataField="role" headerText="Role" width="150"/>
<s:GridColumn dataField="startdate" headerText="Start" width="100"/>
<s:GridColumn dataField="enddate" headerText="End" width="100"/>
<s:GridColumn dataField="presponsibility" headerText="Response" width="150"/>
<s:GridColumn dataField="pcarer" headerText="Carer" width="110"/>
<s:GridColumn dataField="kworker" headerText="Worker" width="110"/>
<s:GridColumn dataField="kteam" headerText="Team" width="110"/>
</s:ArrayList>
</s:columns>
</s:DataGrid>`
结果(注意高度不适合 3 行,它在底部增加了空间)!