remove column from aui-datatable

Sam Meek

I'm trying to remove a column from an aui-datatable but I'm getting a max call stack error.

I'm using AUI for the editable table but it throws a max callstack error exceeded when attempting to remove a column. If I switch back to YUI, by removing the editor and switching aui-datatable to datatable it works fine.

The example I'm working with: 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);
});
Sam Meek

For future reference in case someone else finds this issue:

My actual issue is more complicated than the example I gave but the solution I've found is to remove the table and re-render the table with different headings.

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

Remove the first column from datatable

From Dev

Remove the first column from datatable

From Dev

How to remove column from dataTable

From Dev

Remove row from datatable if column is not numeric

From Dev

DataTable jquery - How to remove sort icon from first column?

From Dev

Remove a column from DataTable based on a where condition using linq

From Dev

DataTable jquery - How to remove sort icon from first column?

From Dev

Remove dataTable Class from datatable

From Dev

Remove dataTable Class from datatable

From Dev

row selection with Liferay AUI datatable

From Dev

Remove rows from a DataTable

From Dev

Dynamic renderURL within aui-datatable

From Dev

Table with aui-pagination and datatable-sort

From Dev

Webix remove columns from a DataTable?

From Dev

How to remove element from datatable

From Dev

remove blank cells from datatable

From Dev

How to remove element from datatable

From Dev

Remove empty columns from a DataTable

From Dev

Remove duplicates from column

From Dev

Remove .x from a column

From Dev

Datatable.Dispose() will make it remove from memory?

From Dev

Remove row from DataTable that contains value

From Dev

How to remove DataColumn from DataTable programmatically

From Dev

How to create new DataTable with column structure from other DataTable?

From Dev

How to create new DataTable with column structure from other DataTable?

From Dev

Get Values from DataTable by row and column name

From Dev

Select single column data from DataTable to list

From Dev

datatable get specific column from row

From Dev

Select Value between two column from datatable