Playground

Samples

class DataTable {

    public columns: Array<string> = new Array<string>();

    public rows: Array<DataRow> = new Array<DataRow>();
}

class DataRow {

    public cells: Array<string> = new Array<string>();
}

class Test {

    public run() {

        var table = new DataTable();
        table.columns.push("ColumnA");
        table.columns.push("ColumnB");
        table.columns.push("ColumnC");

        var row1 = new DataRow();
        row1.cells.push("A1");
        row1.cells.push("B1");
        row1.cells.push("C1");
        table.rows.push(row1);

        var row2 = new DataRow();
        row2.cells.push("A2");
        row2.cells.push("B2");
        row2.cells.push("C2");
        table.rows.push(row2);

        alert(JSON.stringify(table));
    }
}

var test = new Test();
test.run();

相关文章:

  • 2022-01-18
  • 2022-02-07
  • 2021-12-03
  • 2021-11-21
  • 2021-06-04
  • 2022-02-07
  • 2022-12-23
猜你喜欢
  • 2021-09-06
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-02-07
  • 2022-02-21
相关资源
相似解决方案