所以我知道DataGrid的假定行爲是隻呈現可見的單元格。但是在我的應用程序中,我發現數據網格呈現每個可見行的所有列。任何想法爲什麼會發生?爲什麼AdvancedDataGrid渲染所有列而不是可見的列?
每一列都有基於該類型自身的定義ItemRenderer:
public class CustomColumn extends AdvancedDataGridColumn {
public function CustomColumn() {
switch (this.type) {
case A: this.itemRenderer = RendererA;
break;
case B: this.itemRenderer = RendererB;
break;
// more similar code
}
}
謝謝!
編輯:網格屬性。 CustomAdvancedDataGrid擴展了AdvancedDataGrid。
<view:CustomAdvancedDataGrid
id="grid"
wordWrap="true"
alternatingItemColors="[#ffffff,#ffffff]"
horizontalGridLines="true"
width="100%"
height="100%"
fontSize="11"
paddingTop="4"
paddingBottom="6"
lockedColumnCount="1"
verticalLockedSeparatorSkin="{greyLine}"
styleName="gridRowSelection"
headerStyleName="gridHeaderGreen"
dataProvider="{resetGrid(gridModel.hd)}"
updateComplete="gridUpdateCompleteHandler(event)"
displayDisclosureIcon="true"
iconFunction="iconFunction"
useRollOver="false"
sortableColumns="false"
editable="{!this.gridModel.isReadOnly() && !this.model.budgetGridModel.tagsMenuShowing}"
draggableColumns="false"
dragEnabled="{!this.gridModel.isReadOnly() && (this.gridModel.currColumnDef == null)}"
dropEnabled="true"
dragMoveEnabled="true"
dragStart="dragPreventHandler(event)"
dragEnter="dragPreventHandler(event)"
dragDrop="dragDropHandler(event)"
dragOver="dragOverHandler(event)"
dragComplete="dragCompleteHandler(event)"
itemClick="itemClickHandler(event)"
itemEditBegin="itemEditBeginHandler(event)"
itemEditBeginning="itemEditBeginningHandler(event)"
itemEditEnd="itemEditEndHandler(event)"
scroll="scrollHandler(event)"
horizontalScrollPolicy="on"
verticalScrollPolicy="on"
liveScrolling="false"
focusThickness="0"
variableRowHeight="false"
selectionColor="#f8fac8"
disclosureClosedIcon="@Embed(source='../asf/icon_plus_expand.png')"
disclosureOpenIcon="@Embed(source='../asf/icon_minus_minimize.png')"
headerRenderer="ADGHeaderRenderer"
getHighLightedColorFunction="getHighLightedColorFunction"
columnStretch="columnStretchHandler(event)"
rowColorFunction="rowColourFunction"
columns="{gridModel.columnHier}"
displayItemsExpanded="true"
itemOpen="this.itemOpened(event)"
itemClose="this.itemClosed(event)"/>
它在某處指定這是網格的行爲嗎?我預計網格會爲可見行創建渲染器,並且它不會在意某個特定列是否可見。 – 2012-07-27 05:27:42