Search
12 results 1-10
Forum
- 28th Nov 2018.columns().names() is not a functionI'm trying to get my column names: table.columns().names() My DataTable does have names: columns: [ { name: "abc", ...}, { name: "def", ...} ] However I get the following error: .columns(...).names is not a function Am I missing something obvious?
- 12th Apr 2018Can't access .columns().names()Yeah - ideally don't use information from the settings object. It is considered to be private. it can, may and does change between versions at times, so use with caution. If you do use it, wrap any use into a plug-in API method so if it does break in future, you can update it in just one place. Allan
- 23rd May 2025layout adds elements to the html code, but they are not displayed on the site.Получение имен колонок const columnsNames = columnsIndex.map(index => { return api.column(index).header().textContent.trim();
- 5th Apr 2021Mysql equivalent to Datatables search()You could use this little plug-in: $.fn.dataTable.Api.register( 'columns().names()', function () { return this.iterator( 'column', function ( settings, column ) { return settings.aoColumns[column].sName; }, 1 ); } ); And call like: table.columns().names(). I'm assuming you are referring to a name as in columns.name? Allan
- 13th Nov 2020Strange page...Hi @colin Just have a search to columns().names() here and click on column().name() or in case columns().name() to get the link B)
- 26th Sep 2017column().name()I haven't tested it, but this should do it: $.fn.dataTable.Api.registerPlural( 'columns().names()', 'column().name()', function ( setter ) { return this.iterator( 'column', function ( settings, column ) { var col = settings.aoColumns[column]; if ( setter !== undefined ) { col.sName = setter; return this; } else { return col.sName; } }, 1 ); } );
- 12th Oct 2016Getting visible columns namesVery clever - nice one :smile:. Thanks for sharing your solution with us. I'm going to add a columns().names() method in future, the current absence of which is what I was referring to above. Allan
- 23rd Feb 2018API column().name() doesn't exist / is undefinedHello @allan I see the documentation of column().name() or columns().names() and make some tests, but they are undefined. This function has depreciated or removed?
- 9th Apr 2016Estend search range filtering server sidevar count = 1; var columnsNames = []; $('thead th').each(function() { columnsNames.push({'data': $(this).data('name')}); }); var table = $('.myDataTable').DataTable({
- 23rd Nov 2015Selected row column data by columns.nameI have defined the columns.names and I can use