0

配列に入力するオブジェクトを作成し、別のオブジェクト内で配列を定義しました。

    var ListEntry = function (name, code, order) {
        this.name = name;
        this.code = code;
        this.order = order;
    }

    var myObject = Class.extend({
        list: new Array()
    })

後で、これには次のようなデータが入力されます。

    var ListEntry = new ListEntry(cell[0], cell[1], cell[2]);
    this.list.push(ListEntry);

新しいオブジェクトを作成しようとすると、typeError: ListEntry is not a constructor がスローされます。

どんな助けでも大歓迎です!

4

1 に答える 1

0
var listEntry = new ListEntry(cell[0], cell[1], cell[2]);
this.list.push(listEntry);
于 2013-07-02T18:28:04.403 に答える