Search
43826 results 7181-7190
Forum
- 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 }); }
- 12th Aug 2016Table Header is not showing in exported PDF/EXCEL if I am using column search option.hi all, I am a new user to dataTables. I am exporting PDF/EXCEL by using buttons. Here facing one issue. if I am using column search option then header columns are not visible in PDF/EXCEL. Can u please help me. Thanks in advance. here is my code: $('#exampleList thead tr#filterrow th').each( function (exampleListId) { var title = $('#exampleList thead th').eq( $(this).index() ).text(); { $(this).html( '<input type="text" style="width: 90%;" id="exmpl'+exampleListId+'" placeholder="Search '+title+'"/>' ).focusout(function (e) { window.flagfocus=true; window.searchColDets.push({ "column": e.target.id, "value": e.target.value }); }); } }); Party Code Type Party Name City Party Code Type Party Name City
- 20th Jul 2016how to get data from table while click the button at every timeI need to store all required data from server at once and store into the tables.Then i want to get 100 document from every click
- 19th Jul 2016FixedHeader appearing below tableFixed header only appears below my datatable, and only when I resize the window. It seems to be appearing just before the end of the html body. What might be wrong?
- 5th Jul 2016how can i add the following line in the heading format in the data table.Proposed rates = Cubic Allowance 333
- 1st Jul 2016Why search box not fetch data in the tableplz help me..