Просмотр полной версии : проблемы с DataGrid
vladenMX2004
28.10.2005, 00:10
короче, тема такая: парсю xml, запихиваю в Datagrid:
***
cont[k]=({Номер:_root.cnumber, Дата:_root.cdate, Наименование: _root.cname, Срок: _root.csrok, Менеджер: _root.cmanager});
k+=1;
***
_root.table.addEventListener("cellPress", myListener);
_root.table.dataProvider = cont;
***
Теперь, необходимо при клике на строку таблицы, достать поле "Номер"
пытался так:
item=_root.table.getItemAt(event.itemIndex);
trace(item[0]);
так
item=_root.table.getItemAt(event.itemIndex).label;
trace(item[0]);
и т.д.
всё безрезультатно!
прошу помощи
Properties inherited from the List class
The following table lists the properties the DataGrid class inherits from the List class. When accessing these properties from the DataGrid object, use the form dataGridInstance.propertyName.
Property
Description
List.cellRenderer
Assigns the class or symbol to use to display each row of the list.
List.dataProvider
The source of the list items.
List.hPosition
The horizontal position of the list.
List.hScrollPolicy
Indicates whether the horizontal scroll bar is displayed ("on") or not ("off").
List.iconField
A field in each item to be used to specify icons.
List.iconFunction
A function that determines which icon to use.
List.labelField
Specifies a field of each item to be used as label text.
List.labelFunction
A function that determines which fields of each item to use for the label text.
List.length
The number of items in the list. This property is read-only.
List.maxHPosition
The number of pixels the list can scroll to the right, when List.hScrollPolicy is set to "on".
List.multipleSelection
Indicates whether multiple selection is allowed in the list (true) or not (false).
List.rowCount
The number of rows that are at least partially visible in the list.
List.rowHeight
The pixel height of every row in the list.
List.selectable
Indicates whether the list is selectable (true) or not (false).
List.selectedIndex
The index of a selection in a single-selection list.
List.selectedIndices
An array of the selected items in a multiple-selection list.
List.selectedItem
The selected item in a single-selection list. This property is read-only.
List.selectedItems
The selected item objects in a multiple-selection list. This property is read-only.
//*************** DATAGRID ***************///
var n:DataGridColumn = ag.dg.addColumn(new DataGridColumn("Hora"));
ag.dg.getColumnAt(0).width = 53;
var n:DataGridColumn = ag.dg.addColumn(new DataGridColumn("Nota"));
ag.dg.getColumnAt(1).width = 440;
ag.dg.editable=true;
ag.dg.getColumnAt(0).editable=false;
ag.dg.showHeaders=false;
//************ LISTENER DATAGRID
lisdg = new Object();
lisdg.cellFocusOut = function(eventObject){
trace("= " +ag.dg.selectedItem.Hora);
}
ag.dg.addEventListener("cellFocusOut", lisdg)
Работает на vBulletin ® версия 3.7.3. Copyright ©2000-2026, Jelsoft Enterprises Ltd. Перевод: zCarot
Copyright © 1999-2008 Flasher.ru. All rights reserved.