Search
43748 results 7171-7180
Forum
- 19th Oct 2016Column in table as an object property- returns alert if not initHi, here is my setupTable. var setupTable = function () { return $("#myTable").dataTable({ sAjaxSource: config.urls.ajaxSource, sSelectionMode: 'multipleCheckOnly', sDom: '<"$grid-toolbar"s>tr<"dataTables-footer"ilp>', aoColumns: [ { mData: "DeliveryAddress", sWidth: "300px" }, { mData: "Title", sWidth: "180px" }, { mData: "Quantity", sWidth: "60px" }, { mData: "DeliveryAddressDetails.CityName", bVisible: false, bSearchable: false }, { mData: "DeliveryAddressDetails.ZipCode", bVisible: false, bSearchable: false, } ] }); }; ajax returns data with some object as a one of property (DeliveryAddressDetails) but if my json result has a row with not set DeliveryAddressDetails I get javascript alert DataTables warring - requested unknown parameter How to stop it ? in this case i would like to have just null or nothing in DeliveryAddressDetails.ZipCode and DeliveryAddressDetails.CityName column
- 19th Oct 2016How to Customize Data Table Export Excel FormatI want to customize Export Excel Format. Please find attached existing and required excel format images
- 19th Oct 2016Data object not displaying data in my tableHi Peeps Completely noooob at this but if anyone can assist me i would highly appreciate it. I have tried various threads to and nothing is working. Please HELP... If you have any suggestions of how ever else i can do it, please state so, working on a REST API thats needs authentication sent as well. Example of my json object (Its rather a huge source so im cutting it short just to give you an idea of what im working with): { objects: [ { id: "2717eb66-95d3-11e6-860e-001e67260782", type: "alert", updated_at: "2016-10-19T08:08:21Z", display: "You Win", sighting_id: "26341|1476864434252|1", source_system_id: "CLE", alert_id: "27d0992dfba243cab09ebfa18503b89e", timestamp: "2016-10-19T08:07:16Z", time_string: "10:07", alert_type_id: { key: 2, display: "Winner" }......... here is my Javascript: var xhr = new XMLHttpRequest(); xhr.open("GET", api_url, true); xhr.withCredentials = true; xhr.setRequestHeader("Authorization", 'Basic '+btoa(username+':'+password)); xhr.onload = function() { var obj = jQuery.parseJSON(xhr.responseText); $('#maintable').dataTable({ "processing": true, "aaData": obj, "aoColumns": [ { "mData": "objects.id" }, { "mData": "objects.type" }, { "mData": "objects.updated_at" }, { "mData": "objects.display"}, { "mData": "objects.timestamp"} ] }); }; xhr.send(); My Html: <div class="container"> <table id="maintable" class="table table-striped table-condensed"> <thead> <tr> <th>id</th> <th>type</th> <th>updated_at</th> <th>display</th> <th>timestamp</th> </tr> </thead> <tfoot> <tr> <th>id</th> <th>type</th> <th>updated_at</th> <th>display</th> <th>timestamp</th> </tr> </tfoot> <tbody> </tbody> </table> </div>
- 6th Oct 2016Column width or Table width not changingClass Subject Max Min Start date End date Action create create $(document).ready(function() { $('#example').DataTable()( { "aoColumnDefs": [ { "sWidth": "200%", "aTargets": [ 7 ] } ] } ); } );
- 8th Sep 2016Multi select in individual column select input Data tableHow can we implement multi select in individual column select input API?
- 1st Sep 2016JQuery doesen't work after I used the searchbox or I change the page of the table.Hello everyone, I made a JQuery function the one deletes the row I selected. I know that the option exist in the DataTables option, but I want to do by myself, because I prefer to not use AJAX, just JQuery and JSON. The problem appears when I search some specify row in the datatable with the search option, then I click the button to delete, and nothing happens. The other mistake is when I click to the next page, then, all the rows from that page will not work either. Do you guys know what this could be? Here I let my JQuery function: $(document).ready(function() { $( ".botFactura" ).bind( "click", function() { idFact = this.id; var confirmacio = confirm("Do you want to delete this row? "+idFact); if(confirmacio){ $.post("operacions/borraFact.php", {idFact: idFact}, null, "json").done(function(data){ alert(data.missatge); }) } }); }); Then, the JSon file is this one: ``` <?php include("../connexio.php"); $idFact= $_POST['idFact']; $arrayDatos = array(); if($idFact!=""){ $borrar = 'DELETE FROM factures WHERE id="'.$idFact.'"'; //$connBorr = mysqli_query($conn,$borrar); $arrayDatos['missatge'] = "Factura ".$idFact." esborrada!"; }else{ $arrayDatos['missatge'] = "No s'ha trobat"; } echo json_encode($arrayDatos); I would appreciate any solution or something that could help me to correct the issue! Thank you!
- 29th Aug 2016inner join 4 table in server-side and active the searching datai had a problem with datatables, i can't showing data in datatables with this php : <?php ` $db = new mysqli('localhost', 'root', '', 'permata'); // storing request (ie, get/post) global array to a variable $requestData = $_REQUEST; $columns = array( // datatable column index => database column name 0 => 'id_hanca', 1 => 'id_detail_po', 2 => 'ukuran', 3 => 'jumlah_hanca', 4 => 'status_hanca', 5 => 'id_user', 6 => 'id_vendor' ); // getting total number records without any search $sql = $db->query("SELECT po_detail.id_detail_po, hanca.id_hanca, hanca.ukuran, hanca.jumlah_hanca, user.name_usr, vendor.nama_vendor FROM hanca INNER JOIN po_detail ON po_detail.id_detail_po = hanca.id_detail_po INNER JOIN user ON user.id_usr = hanca.id_user INNER JOIN vendor ON vendor.id_vendor = hanca.id_vendor"); $totalData = $sql->num_rows; $totalFiltered = $totalData; // when there is no search parameter then total number rows = total number filtered rows. $sql = $db->query("SELECT po_detail.id_detail_po, hanca.id_hanca, hanca.ukuran, hanca.jumlah_hanca, user.name_usr, vendor.nama_vendor FROM hanca INNER JOIN po_detail ON po_detail.id_detail_po = hanca.id_detail_po INNER JOIN user ON user.id_usr = hanca.id_user INNER JOIN vendor ON vendor.id_vendor = hanca.id_vendor"); $sql.= "WHERE 1=1"; if (!empty($requestData['search']['value'])) { // if there is a search parameter, $requestData['search']['value'] contains search parameter $sql.=" AND ( id_hanca LIKE '%" . $requestData['search']['value'] . "%' "; $sql.=" OR jumlah_hanca LIKE '%" . $requestData['search']['value'] . "%' "; $sql.=" OR ukuran LIKE '%" . $requestData['search']['value'] . "%' )"; } $query = $sql; $totalFiltered = $query->num_rows; // when there is a search parameter then we have to modify total number filtered rows as per search result. $sql.=" ORDER BY " . $columns[$requestData['order'][0]['column']] . " " . $requestData['order'][0]['dir'] . " LIMIT " . $requestData['start'] . " ," . $requestData['length'] . " "; $query = $sql; $data = array(); $no = 1; foreach ($query as $row) { //Nama User // $qry = $db->query("SELECT name_usr FROM user WHERE id_usr='" . $row['id_user'] . "'"); // $nm_user = $qry->fetch_assoc(); $nestedData = array(); $nestedData[] = $no++; $nestedData[] = $row['id_detail_po']; $nestedData[] = $row['ukuran']; $nestedData[] = $row['jumlah_hanca']; $nestedData[] = $row['name_usr']; $nestedData[] = $row['nama_vendor']; // Input Hiddden to include value for update cart // Add html button for action $nestedData[] = "<a href='#' class=\" btn btn-info btn-xs btn-flat\" data-toggle=\"tooltip\" data-placement=\"top\" title=\"Detail Belanja\"><span class=\"glyphicon glyphicon-search\"></span> Detail</a>"; $data[] = $nestedData; } $json_data = array( "draw" => intval($requestData['draw']), // for every request/draw by clientside , they send a number as a parameter, when they recieve a response/data they first check the draw number, so we are sending same number in draw. "recordsTotal" => intval($totalData), // total number of records "recordsFiltered" => intval($totalFiltered), // total number of records after searching, if there is no searching then totalFiltered = totalData "data" => $data // total data array ); echo json_encode($json_data); // send data as json format ` its not work, how to i fix it ? please help me !!! :(
- 20th Aug 2016How can I Export multi table to PDFHi Guys, I want to export about n* Tables into a single PDF Document. Is there any functionality to build this? thanks
- 19th Aug 2016Export text block before table dataHi, I'm showing some queries results with datatables component and it works perfectly fine, smooth and nice. The only thing I couldn't do is to export this queries parameters (i've tried assigning the text to the "title" attribute by using a hidden field but this didn't work). This is a requirement for the development i'm facing right now and just can't find any example or thread that help me deal with this task. I think I'm not the first developer trying to do this, could anyone point a finger to the correct direction please? Thanks in advance! MG
- 12th Aug 2016Data table column rendering with ajax responseI am trying to render column contents with ajax response but it doesn't display anything in the column despite ajax response returning data, { "width": "20%","targets": 6, "defaultContent": '', "render": function ( data, type, row ) { if(row.colData !=''){ $url="server request url"; var ret= row.colData var aydGuid=row.guid; var params = {relatedHID:ret,guid:aydGuid}; $.ajax({ url: $url, async: true, data: jQuery.param(params), dataType:'html' }).done(function( data ) { alert(data) //displays response return data //does nothing }); }