my test case is http://montaj.vianor-konakovo.ru/goods_new111.html
I need to memorize the state of the table and, if necessary, restore the original state. Now I have achieved that the table restores its state upon restart, for this I have the function recove_order and I call it..in event init. and everything works. I get the desired result.but as soon as I try to go to another page and return to the original page, the application does not work in the way I need: the state of the table does not restore to its original state. I try to restore it the same way as when I reboot. The difference is that when I change the page, I call the restore function record_order in event xhr line 310 in the file
goods1003_new.js
What could be the source of the problem? How to adjust the code so that the table is restored correctly when returning to the original page
why events xhr and draw in a bunch do not work as I need?
Angular 8 server-side datatable with Laravel framework
Hello, I am trying to list the data that comes from an api in Laravel, I am using Yajra and it returns a result in this way
in component.ts the following code:
in html:
Apparently the page works but it does not show the registers despite the fact that in console
I hope you can help me please
Is there any way of highlighting entire row on hover when there are fixed columns
I found this solution --
https://datatables.net/forums/discussion/13856/highlighting-entire-row-on-hover-with-fixed-columns
Is there any other way of doing this.
enable search and filtering on server-side datatable using foreign keys names not id's
Hi guys,
i am using server-side datatable, i have 2 foreign keys, i am showing not id's but name in other table. But when i make search and enter names it doesn't work, i want to enable search only in showed attributes. Thanks
<?php
//include connection file
include_once("connection.php");
// initilize all variable
$params = $columns = $totalRecords = $data = array();
$params = $_REQUEST;
$columns = array( 'id_doc','ref','taille','date_ajout' , 'type', 'nature', 'date_doc', 'date_echeance', 'date_notif', 'date_modif');
$where = $sqlTot = $sqlRec = "";
// check search value exist
if( !empty($params['search']['value']) ) {
$where .=" WHERE ";
$where .=" ( id_doc LIKE '%".mysql_real_escape_string($params['search']['value'])."%' ";
$where .=" OR date_ajout LIKE '%".mysql_real_escape_string($params['search']['value'])."%' ";
$where .=" OR type LIKE '%".mysql_real_escape_string($params['search']['value'])."%' ";
$where .=" OR nature LIKE '%".mysql_real_escape_string($params['search']['value'])."%' ";
$where .=" OR date_doc LIKE '%".mysql_real_escape_string($params['search']['value'])."%' ";
$where .=" OR date_echeance LIKE '%".mysql_real_escape_string($params['search']['value'])."%' ";
$where .=" OR date_notif LIKE '%".mysql_real_escape_string($params['search']['value'])."%' ) ";
}
// getting total number records without any search
$sql = "SELECT * FROM `document` ";
$sqlTot .= $sql;
$sqlRec .= $sql;
//concatenate search sql if value exist
if(isset($where) && $where != '') {
$sqlTot .= $where;
$sqlRec .= $where;
}
$sqlRec .= " ORDER BY ". $columns[$params['order'][0]['column']]." ".$params['order'][0]['dir']." LIMIT ".$params['start']." ,".$params['length']." ";
$queryTot = mysqli_query($conn, $sqlTot) or die("database error:". mysqli_error($conn));
$totalRecords = mysqli_num_rows($queryTot);
$queryRecords = mysqli_query($conn, $sqlRec) or die("erreur en affichant l historique");
//iterate on results row and create new index array of data
include 'connect.php';
while ( $aRow = mysqli_fetch_array( $queryRecords ) ){
$row = array();
for ( $i=0 ; $i<count($columns) ; $i++ )
{
if ( $columns[$i] == "type" )
{
/* Special output formatting for 'version' column */
$comp=$aRow[ $columns[$i] ];
$sql="SELECT * FROM document_type where id_type='$comp'";
$req= mysql_query ($sql) ;
$datay= mysql_fetch_array($req);
$val = $datay['nom'];
$row[] = $val;
}
else if ( $columns[$i] != ' ' )
{
/* General output */
$row[] = $aRow[ $columns[$i] ];
}
}
//$output['data'][] = $row;
$data[] = $row;
}
$json_data = array(
"draw" => intval( $params['draw'] ),
"recordsTotal" => intval( $totalRecords ),
"recordsFiltered" => intval($totalRecords),
"data" => $data // total data array
);
echo json_encode($json_data); // send data as json format
?>
Edited by Colin - Syntax highlighting. Details on how to highlight code using markdown can be found in this guide.
[And joined two threads together as both stuck in spam filter]
.draw() not working
Here is the example:
https://codesandbox.io/s/trusting-chandrasekhar-usenq
So why exactly is .draw() not working? The drawCallback never fires and the table shoes the records in the wrong order. In the console you can see the correct ordered data.
I thought by calling ".draw" I would update the DataTable.
How to avoid unwanted responsive layout
Hi,
first of all, thanks for the tool, I really like it. I am a beginner in programming and I have an issue which I can't find. I use Bootrap4 with your table and I keep everything simple. Without anything adding there seems to be a breakpoint at 767px, where the searchbar (footer --> e.g. "0 - 10 results from 12") will jump to right (left). How can I avoid that (let's stay both in the middle). Furthermore I want the pagination always in the middle under the footer.
The documentation for layout get's an 404 error.
Thank you in advance
Datatables with Semantic UI getting strange behavior
I cannot seem to track down why it is doing it, and I am not sure if it is something that needs to be fixed within datatables and columnToggle or not.
http://live.datatables.net/nawepehe/11/edit
If you look at the columnToggle button box, you will see the button wrap ends before the buttons end. Specifically scroll to the right and the last "Name" button you will see the button box ends but buttons continue.
The other issue is the show entries box is not selectable anymore. I know it has something to do with the class "form" because when I remove it, the drop down works.
Any suggestions?
When editing , previous line items value is retained in dropdowns
Lets say there are 2 line items. I select lineitem1 click Edit and then Update it.
Now I select lineitem2 and click Edit, I see previous lineitem's values (i.e. lineitem1's values ) instead of lineItem2 .
Below is whats happending in the code. When I click on datatable Edit .
debugger is going to all the editor.dependent's like below. editor_preOpen is false here .
''' editor.dependent('Product[].id', function (val, data, callback) {
if (editor_preOpen) {
if (val !== null && val !== "null") {
editor.field("Audience[].id").val('');
GetAudByProductID(val, callback);
}
}
});'''
And then it actually goes to preOpen function.
'''editor.on('preOpen', function (e, json, data) '''
If answer is repopulating , where should i do it.
how to format a column with excelHtml5?
Hi, I would like to know if I can format a column in .xlsx text only, I am new to this kind of thing. What happens is that a column that has serial numbers and the last digits are set to 0 because they are numbers (Image attached).
Leaving data alone
I'm sure this is out there somewhere I'm just not using the right search criteria. If we input something like January 21-23 into a text field (using latest DT & Editor) it converts that to a date. Is there a universal way to tell DT / Editor to treat the data as verbatim and not convert to a date (or an int ... etc.)?
Feature request: Allow successCallback data of ajax not to be merged with existing row data.
Hello, currently, if you have set drawType === 'none'
, you need to manually pass new or updated row data to successCallback
as a result of ajax request to make the table row update itself with the new data. The passed row data is then internally merged with existing table row data, to fill in missing properties, in case just a sub-set of row fields was returned. However, in our business case, we also expect that some of the fields are missing intentionally in the returned set of data, and we render these columns in a specific way. However, editor fills in these missing fields with cached table row fields.
Here's a snippet from editor 1.9.2 starting at line #6956:
// Merge data to allow for a sub-set to be returned
var extender = $.fn.dataTableExt.oApi._fnExtend;
var toSave = extender( {}, row.data(), true );
toSave = extender( toSave, data, true );
row.data( toSave );
Could this behaviour be optionally disabled, so user can manually set, what data are passed back to datatable renderers after successful edit?
Proposal: Add a switch setting, for example allowSubsetResponse
, which when set to false, would not automatically merge the data passed to successCallback
with respective table row data.
Thanks for the response.
Rado
How many projects per license?
Hi, I currently have 1 license of dataTables. In how many projects can I use this license?
Thank you
Editor Line 958: Warning In Count()
Greetings
I've encountered a problem in this Line in Editor.php File (1.9.2):
if ( count($data, COUNT_RECURSIVE) >= ini_get('max_input_vars') ) {
$this->_out['error'] = 'Too many rows edited at the same time (tech info: max_input_vars exceeded).';
}
It gave me this error on some occasions:
<b>Warning</b>: count(): Parameter must be an array or an object that implements Countable in <b>D:\laragon\www\hddclinic\api\app\vendor\datatables.net\editor-php\Editor.php</b> on line <b>959</b><br />
I tried to var_dump the $data variable, and it was NULL.
I Do not know what this line do exactly, but I decided to add this:
if ( $data && count($data, COUNT_RECURSIVE) >= ini_get('max_input_vars') ) {
$this->_out['error'] = 'Too many rows edited at the same time (tech info: max_input_vars exceeded).';
}
I don't know if that would have any side-effects.
Datatables "compact" class prevents centering of elements
I've got a datatable that I can't seem to get the text within <th> elements centered. If I remove the compact class from the table, the header <th> elements center just fine.
Is there a solution where I could have the <th> elements centered and keep using the "compact" class?
A few notes about my setup:
-bootstrap 4
-lots of options for datatables being used (fixed columns, server side processing, etc)
How to replace error message and prevent upload?
Currently I’m allowing the user to upload a JSON file which is then translated into the datatable below it. However, if the user attempts to upload a file without the proper data, it will display a datatables error pointing it out and it will still send the data to the datatables.
My question is two parts: 1) how do I replace the system error with something more front end friendly, and 2) how do I prevent a file that triggers such an error from being sent to the datatable?
Foundation styling supported?
Hi,
I see the claim of supporting Foundation here https://datatables.net/examples/styling/foundation.html
But the pagination looks messed up.
Is that a bug? or does it work fine?
Also, how do I configure the table to just show Next and Prev buttons like in one of the other examples?
thanks!
How to get data from two different columns and merge together with rows of each?
How do I get data from two different columns and merge them together but not by concatenating them. I was thinking that they would have rows of each. Can this be done with just a function in datatables?
Excel export throwing error in MS excel
buttons: [ {
extend: 'excelHtml5',
title: '',
customize: function( xlsx ) {
var sheet = xlsx.xl.worksheets['sheet1.xml'];
$('row c', sheet).each( function () {
if ( $('is t', this).text().indexOf("http") === 0 ) {
$(this).append('<f>' + 'HYPERLINK("'+$('is t', this).text()+'","'+$('is t', this).text()+'")'+ '</f>');
$(this).attr( 's', '2' );
}
});
}
} ],
I am trying to convert text to hyperlinks in excel so that they are clickable directly. These are image URLs from the table that get converted to plain text when i open the sheet. The above snippet throws an error in MS office.
It seems that my modification to the text to hyperlink has broken the parsing. Unsure why but it opens up fine in WPS and google sheets.
I have attached the excel that is causing an issue.
Free Download Data Recovery Software
If you are finding the smart solution for Free Download Data Recovery Software, then you can try ZOOK Data Recovery Software is the best utility to retrieve all the lost, formatted data files of external and internal storage devices pen-drive, Windows, SD card, Hard-disk, etc. It allows the users to access multiple data files in minutes. This utility is capable enough to restore multiple files such as photos, videos, emails, etc. It supports FAT 16, FAT32, NTFS, etc.
I hope the shared information would be helpful for you. If you want to download a free demo version of Data Recovery Software so you can click this link: https://download.cnet.com/Zook-Data-Recovery-Wizard/3000-2248_4-78360503.html
data table editor
Uncaught TypeError: $.fn.dataTable.Editor is not a constructor
facing this type of error