1
我想從aui-datatable中刪除一列,但我得到一個最大調用堆棧錯誤。從aui-datatable刪除列
我爲可編輯表使用AUI,但它在嘗試刪除列時會引發超出最大調用堆棧錯誤。如果我切換回YUI,通過刪除編輯器並將aui-datatable切換到數據表,它可以正常工作。
我的工作的例子: http://jsfiddle.net/72Tsf/
var table, applePie, Y, pieList, pieTest;
YUI().use('model', 'aui-datatable', 'datatable-mutable', function (Y) {
Y.PieModel = Y.Base.create('pieModel', Y.Model, [], {}, {});
Y.PieList = Y.Base.create('pieList', Y.ModelList, [], {
model: Y.PieModel
});
pieList = new Y.ModelList({model: Y.PieModel});
table = new Y.DataTable({
columns: [
{key: 'type', editor: new Y.TextCellEditor()},
{key: 'slices'}
],
data: pieList
});
table.render();
applePie = new Y.PieModel({type: 'apple', slices: 1});
pieList.add(applePie);
pieList.add(new Y.PieModel({type: 'apple2', slices: 2}));
pieTest = new Y.Model({});
pieTest.set('type', 'apple');
pieList.add(pieTest);
table.removeColumn(0);
});