FPTable - flashpress/FPNativeUI GitHub Wiki

import ru.flashpress.nui.events.FPTableEvent;
import ru.flashpress.nui.constants.FPTableCellStyle;
import ru.flashpress.nui.view.control.FPTable;
import ru.flashpress.nui.FPNativeUI;
import flash.geom.Rectangle;

FPNativeUI.init();
//
var bounds:Rectangle = new Rectangle(0, Capabilities.screenResolutionY-200, Capabilities.screenResolutionX, 200);
//
var table:FPTable = new FPTable();
table.frame = bounds;
table.cellStyle = FPTableCellStyle.DEFAULT;
//
table.stage.addChild(table);
table.addEventListener(FPTableEvent.SELECTED, valueChangeHandler);
//
var dataSource:Array = [];
dataSource[0] = ['value11', 'value12', 'value13'];
dataSource[1] = ['value21', 'value22', 'value23', 'value24'];
table.dataSource = dataSource;
table.titleForHeaders = new <String>['Values1', 'Values2'];

function valueChangeHandler(event:FPTableEvent):void
{
	trace(event.index);
}
⚠️ **GitHub.com Fallback** ⚠️