WHAT'S NEW?
Loading...

DataGrid Component as3 Part4


Tutorial Details
  • Judul: DataGrid Component as3 Part4
  • Difficulty: Beginner
  • Platform: Flash (Flash Player 10)
  • Bahasa Scripth: AS3
  • Software : Flash Professional CS4/Flash Professional CS5
  • Estimated Completion Time: 15 minutes
  • Created:Ricko Nada (Pustaka Flash)





live demo :

Scripth yang digunakan :
import fl.data.DataProvider;
import fl.controls.dataGridClasses.DataGridColumn;

myGrid.move(10,10);
myGrid.setSize(350, 100)

var col_Nama:DataGridColumn = new DataGridColumn("Nama");
myGrid.addColumn(col_Nama);

var col_Umur:DataGridColumn = new DataGridColumn("Umur");
myGrid.addColumn(col_Umur);
col_Umur.sortOptions = Array.NUMERIC;

var col_Pekerjaan:DataGridColumn = new DataGridColumn("Pekerjaan");
myGrid.addColumn(col_Pekerjaan);

myGrid.columns[0].width=140
myGrid.columns[1].width=75
myGrid.columns[2].width=150

var textFormat1:TextFormat = new TextFormat();
textFormat1.size = 16;
textFormat1.color = 0x0000CC;
textFormat1.bold = true;
textFormat1.font = "Arial"

myGrid.setStyle("headerTextFormat", textFormat1);

var textFormat2:TextFormat = new TextFormat();
textFormat2.size = 12;
textFormat2.italic = true;
textFormat2.font = "Verdana"

myGrid.setRendererStyle("textFormat", textFormat2);


var myData:Array = [{Nama: "John Jenkins", Umur: "31", Pekerjaan: "Programer"},
{Nama: "Anna Watson", Umur: "28", Pekerjaan: "Docter"},
{Nama: "Susan McCallister", Umur: "29", Pekerjaan: "Koki"},
{Nama: "Joe Thompson", Umur:"32", Pekerjaan: "Jaksa"},
{Nama: "Bob Anderson", Umur:"31", Pekerjaan: "Sales"},
{Nama: "William Thompson", Umur:"2", Pekerjaan: "Bayi"},
{Nama: "Oscar Anderson", Umur:"3", Pekerjaan: "Bayi"}];

myGrid.dataProvider = new DataProvider(myData);

myGrid.rowCount = myGrid.length;



0 komentar:

Post a Comment