Search
43891 results 6951-6960
Forum
- 1st Apr 2015Inserting rows in middle of tableMaybe this is not possible? It does appear to work, but if you try to delete a row after adding, the added rows go back to the bottom. Here is the pertinent code code from the above live site: testTable = $('#test-table').DataTable({ "data": dataForDataTables, "destroy": true, "pageLength": 25, "columns": [ { "data": "SortIndex" }, { "data": "DataGroup", "orderable": false }, { "data": "Number1", "orderable": false }, { "data": "Number2", "orderable": false }, { "data": "Label1", "orderable": false }, { "data": "Label2", "orderable": false }, { "data": "Delete", "orderable": false, "render": delete_icon }, { "data": "Insert", "orderable": false, "render": add_icon } ] }); $('#test-table tbody').on('click', 'i.glyphicon-plus-sign', function (event) { var insertedRowIndex = testTable.row($(this).parents('tr')).index(); addRow(); var lastRowIndex = testTable.page.info().recordsTotal - 1; //re-number sortIndex column to reflect added row $.each(testTable.rows().data(), function (i, row) { var firstCell = testTable.cell(i, 0); if (i < insertedRowIndex) { firstCell.data(i); } else if (i >= insertedRowIndex && i != lastRowIndex) { firstCell.data(firstCell.data() + 1); } else if (i == lastRowIndex) { firstCell.data(insertedRowIndex); } }) testTable.order([0, 'asc']).draw(); }); function addRow() { testTable.row.add({ "SortIndex": testTable.page.info().recordsTotal, "DataGroup": $("#select-data").val(), "Number1": "", "Number2": "", "Label1": "", "Label2": "" }).draw(); }
- 13th Mar 2015Table Joins: Does Editor have support for "Or" statements and "Sum Of"?could not recognize constants or variables which are declared in external files. They can, but you need to use the use() statement: ->where( function ( $q ) use ( $CONST_STATUS_START, $CONST_GROUP_EMPTY ) { This is all part of PHP's awful handling of globals and variable scope... I quite like PHP, but it does have issues such as this - particularly if you are used to Javascript. Allan
- 21st Feb 2015Link tr tableLook for "Use as a function to create a link from the data source:" in this example: https://datatables.net/reference/option/columns.render
- 11th Feb 2015Responsive columns falling off of table in chromeAlso it looks like the recalc function never gets called when the browser maximizes, un-maximizes, or snaps to the side of the screen atleast in windows 8 running chrome 40
- 10th Feb 2015in the data table i want to call the server every time i click on next or 1 or 2Use the bServerSide option if you are using a legacy version of DataTables. serverSide is the new option. Allan
- 7th Feb 2015Filtered data exported with table tools.Finally figured this out. Updated code var oTable = $('#SensorData').DataTable( { "bServerSide": false, "order": [[2, "desc"]], dom: 'T<"clear">lfrtip', tableTools: { "sSwfPath": "assets/swf/copy_csv_xls_pdf.swf", "aButtons": [ { "sExtends": "copy", "mColumns": [1, 2], "oSelectorOpts": { filter: "applied", order: "current" } }, { 'sExtends': 'xls', "mColumns": [1, 2], "oSelectorOpts": { filter: 'applied', order: 'current' } }, { 'sExtends': 'print', "mColumns": [1, 2], "oSelectorOpts": { filter: 'applied', order: 'current' } }, { 'sExtends': 'pdf', "mColumns": [1, 2], "oSelectorOpts": { filter: 'applied', order: 'current' } }, { 'sExtends': 'csv', "mColumns": [1, 2], "oSelectorOpts": { filter: 'applied', order: 'current' } } ] }, "columnDefs": [ { "targets": [0], "visible": false, "searchable": false } ] });
- 27th Jan 2015Datatabls only showing first 10 rows of 200 row tableHi I've now managed to solve. I was convinced the data via Ajax included all the rows as the records count indicated the correct number. I drilled further and discovered an error in the php laravel package that forced a default record limit of 10 if no parameter set. I've now reverted to an earlier version of the package and all resolved. Not a databases issue but a data issue Thank you for the pointer
- 16th Jan 2015how to load a table order by particular columnCan you link me to the page then please, so I can debug it. Allan
- 27th Dec 2014When use columns [ , data table return unknown style error"className": .... http://datatables.net/reference/option/columns.className
- 22nd Dec 2014DataTables warning: table id=schedule_socialmedia - SQLSTATE[42S22]: Column not found: 1054 UnknownGot it - thanks! That comment is nonsense. I'm going to package up a new beta of Editor 1.4 today, and I'll get this sorted out for that. Thanks for flagging it up! Allan