Search
43748 results 7121-7130
Forum
- 21st Oct 2021i wanna make table like this , anybody nowLink to test case: Debugger code (debug.datatables.net): Error messages shown: Description of problem:
- 10th Aug 2021DataTables warning: table id=main-data-table - Invalid JSON response.Here is my Controller: ~~public function door_to_door($request_type = ""){ switch($request_type){ case "list" : header("Content-Type: application/json"); $datatable = $this->get_datatable(); $data['data'] = $this->admin->fetch_doortodoor_rate( $datatable['limit'], $datatable['offset'], $datatable['search']['value'] ); $data['draw'] = $datatable['draw']; $data['recordsTotal'] = $this->db->count_all('door_to_door_rates'); $data['recordsFiltered'] = $this->crud->fetch_door_to_door_rate_count($datatable['search']['value']); echo json_encode($data); return; } $data['active']='rate_management'; $data['module_name'] = ''; $data['company_contacts'] = $this->crud->get_company_contacts(); $this->load->view("door_to_door_rates",$data); }~~ And here is my view script: ~~ Pickup Area Drop Off Area Rate </div> </div> </div> </div> </div> <script type='text/javascript'> $("#main-data-table").DataTable({ ajax: { url: ' <?= base_url()?>/admin/door_to_door/list', dataSrc:'data' }, serverSide:true, columns: [ {data: null, render:function(data,type,row){ return row.start_area_name + ", " + row.start_province_name; }}, {data: null, render:function(data,type,row){ return row.end_area_name + ", " + row.end_province_name; }}, {data: "rate"} ] }); </script>~~ How can I fix the error?
- 29th Jul 2021Different Data Sources With Same Structure. One is read by table, other is notLink to test case: https://jsfiddle.net/BeerusDev/okn1e3tf/1/ The test case linked above is a working example with static data. At the end of my footerCallback I have a function updateOutsideCount(). In my static example, I call transformedResults in my flatMap(), and everything works fine, and you can see in the console when you search a previous date (i.e. 7/20/2021) it logs transformedResults in the console. Here is how it looks: { Days: [{ Date: "07/26/2021", Day: "Monday", Location: "Present", Status: "P" }, { Date: "07/27/2021", Day: "Tuesday", Location: "Not Recorded", Status: "NR" }, { Date: "07/28/2021", Day: "Wednesday", Location: "Meeting at Client", Status: "TRV" }, { Date: "07/29/2021", Day: "Thursday", Location: "Meeting at Client", Status: "TRV" }, { Date: "07/30/2021", Day: "Friday", Location: null, Status: null }], Department: "IT", Employee: "Goten Dev" } In my actual example, I cannot use transformedResults because it is not defined, I defined it in my AJAX call and pushed it through as data. When I console.log(data) in my actual dynamic example this is how it is formatted, looks exactly like transformedResults: { "Department": "IT", "Employee": "Sample Dev", "Days": [ { "Day": "Monday", "Date": "7/19/2021", "Status": "P", "Location": "Office" }, { "Day": "Tuesday", "Date": "7/20/2021", "Status": "P", "Location": "Office" }, { "Day": "Wednesday", "Date": "7/21/2021", "Status": "P", "Location": "Office" }, { "Day": "Thursday", "Date": "7/22/2021", "Status": "P", "Location": "Office" }, { "Day": "Friday", "Date": "7/23/2021", "Status": "P", "Location": "Office" } ] } Here is a screenshot How come transformedResults.flatMap() is working, but data.flatMap() is not a function? I can do data.Days.flatMap(), but that leaves dayArray undefined? Here is my JSFiddle for my dynamic version, it includes all of my JS: https://jsfiddle.net/BeerusDev/053zyoL4/8/ The only issue is the ending of my footerCallback! I hope I provided enough test cases/documentation. This has been driving me insane not being able to figure it out.
- 16th Jan 2020it is possible to add a footer to the bottom of the page instead of the table, but only on the lastya he buscado soluciones pero no encuentro requiero ayuda
- 21st Nov 2019Button in table row not showing in responsiveI have a datatable that includes buttons in some of the columns, however when the breakpoint is reached to 'hide' the column where the buttons reside, the button function disappears and it converts to text. Unfortunately I don't have a live example of it and cannot provide for security reasons.
- 6th Nov 2019table having 2 rows based on id.how to cumulative to make single row inatatable library$(document).ready(function () { var empTable = $('#reportTable').dataTable({ "aaSorting": [[0, "asc"]], "iDisplayLength": , "aLengthMenu": [[10, 25, 50, 100, -1], [10, 25, 50, 100, ""]], 'bProcessing': true, 'bServerSide': true, "scrollX": true, 'sAjaxSource': 'payment/getAmountData', 'fnServerData': function (sSource, aoData, fnCallback) { $.ajax({ 'dataType': 'json', 'type': 'POST', 'url': sSource, 'data': aoData, 'success': fnCallback }); }, 'fnRowCallback': function (nRow, aData, iDisplayIndex) { var oSettings = empTable.fnSettings(); nRow.id = aData[0]; var nCells = nRow.getElementsByTagName('td'); var basic_pay = reduce(aData[4]); var total = ceiling(parseFloat(aData[4]) + parseFloat(aData[5])); var total_salary = ceiling(parseFloat(total) + parseFloat(aData[6]) + parseFloat(aData[7]) + parseFloat(aData[8]) + parseFloat(aData[9]) + parseFloat(aData[10])); var begin_total = 0; var gpf = 0; var final_total = 0; nCells[6].innerHTML = currencyFormat(basic_pay); nCells[6].innerHTML = currencyFormat(total); nCells[12].innerHTML = currencyFormat(total_salary); return nRow; }, "aoColumns": [ { "bSortable": false }, { "bSortable": false }, { "bSortable": false }, { "bSortable": false }, { "bSortable": false, "mRender": currencyFormat }, { "bSortable": false, "mRender": currencyFormat }, { "bSortable": false, "mRender": currencyFormat }, { "bSortable": false, "mRender": currencyFormat }, { "bSortable": false, "mRender": currencyFormat }, { "bSortable": false, "mRender": currencyFormat }, { "bSortable": false, "mRender": currencyFormat }, { "bSortable": false, "mRender": currencyFormat }, { "bSortable": false, "mRender": currencyFormat }, { "bSortable": false, "mRender": currencyFormat }, { "bSortable": false, "mRender": currencyFormat }, { "bSortable": false, "mRender": currencyFormat } // , { // "bSortable": false // } ] }); }); try { $this->load->library('datatables'); $query = $this->datatables->select(' employee_info.employee_id as employee_id, employee_info.employee_name, e.designation_name, scale_pay.name, employee_info.basic_pay, employee_info.grade_pay, 0 as total, c.da, c.hra, c.ta, c.da_on_ta, c.fma, 0 as total_salary, 0 as begin_total, 0 as gpf, 0 as final_total ')->from('employee_info') ->join('scale_pay ', 'scale_pay.id = employee_info.scale_of_pay', 'left') ->join('designation e', 'e.designation_id = employee_info.designation_id') ->join('month_pay c', 'c.employee_id = employee_info.employee_id') ->join('monthly_deduction f', 'f.employee_id = employee_info.employee_id AND f.monthyear') // ->group_by('employee_info.employee_id') // ->group_by('employee_info.basic_pay') ->where($where); echo $this->datatables->generate(); } catch (Exception $e) { throw new Exception("Error Processing Request", 1); }
- 26th Sep 2019How to bind to Label showing 1 to 10 of 39 entries to label in Jquery data table, PagenationEx: showing 1 to 10 of 39 entries showing 11 to 20 of 39 entries showing 21 to 30 of 39 entries showing 31 to 39 of 39 entries
- 1st Jul 2019Table only returning first letterHi, i'm currently learning javascript. I have a project for testing purpose, i wanted to setup mongodb as the data source and use datatables as to display the data on electron framework. So electron, mongodb, datatables combined. async function getName() { let result = [] try{ const name = await loadCollection() await name.aggregate({$match: {founded_year:2010}},{$group : {_id:"$name"}}).forEach(function(u) { result.push(u.name) }) } catch(e){ console.log(e) } console.log(result) return result } let datas = getName().then(function(x){ $('#table1').DataTable({ data : x })}) I have had a success on connecting those 3 modules. However, datatables is only getting the first letters of each data. here as you can see, in the console log my function outputs the array correctly which i believe means that there is nothing wrong with the backend. I can't find where the problem is. Hoping to get answers from you guys soon! Thank you
- 14th Mar 2019button click data table not workwhen i click the button (index):1311 Uncaught TypeError: $(...).DataTable is not a function at initial ((index):1311) at HTMLButtonElement. ((index):1304) at HTMLButtonElement.dispatch (VM1584 index.js:3074) at HTMLButtonElement.elemData.handle (VM1584 index.js:2750) it will show
- 11th Mar 2019how can change the default sheet right to left option in my data table when i export to excelwhen i try to make an excel files from the datatable, always the excell come with ltr option . how i can change it to rtl by default when i make a excel file from my datatable options