Welcome Guest, Not a member yet? Register   Sign In
Ignited DataTables

[eluser]Unknown[/eluser]
I'm using this library, but when I'm using GROUP_CONCAT() search is not working.

Code:
$this->datatables->select('branches.id,branch_name,branch_address,latitude,longitude,district,phone,branch_email')
            ->unset_column('branches.id')
   ->from('branches')
            ->join('branch_services', 'branches.id = branch_services.bid', 'LEFT')
            ->join('services_avialable', 'services_avialable.id = branch_services.sid', 'LEFT')
            ->select('GROUP_CONCAT(services_avialable.service) as services')
            ->group_by('branches.id')

[eluser]CroNiX[/eluser]
Not sure about datatables, but with regular CI you'd use the 2nd parameter of select and set it to FALSE so CI doesn't escape the table identifiers, which doesn't work well using functions:
Code:
->select('GROUP_CONCAT(services_avialable.service) as services', FALSE)

Not that it really matters as it's code, but you spelled available wrong in services_avialable, which can make maintaining code hard, especially if someone else ever works on it.

[eluser]Unknown[/eluser]
Hi, thanks for this excelent library, im using this library to generate datatables from DB data, but i want to get the ID from the DB table and add an id to each row ( each TR) in the table. I know how to use DT_RowId without Ignited datatables , but dont know how to use it with this library, any sugestion?

Thanks and good code.

[eluser]pakistanihaider[/eluser]
How to use join query using Ignited Datatables library??

[eluser]pakistanihaider[/eluser]
Code:
$this->datatables->select('FormID, FormName, FormPath, FormCIPath')
         ->unset_column('FormID')
         ->from('sys_forms');
     echo $this->datatables->generate();

the above code can get me data, but it do not filter.

i can see the filtering funcion in datatables in library.. but how to use it. i cant find the documentation for it.

can any one plz help me with the functions in datatables.?


i have grid and data is loading just fine but the search is not working..

[eluser]Johan N.[/eluser]
[quote author="Jeroma" date="1398844991"]...Here is adapted for work with PostgreSQL library...[/quote]

Where? Please?

[eluser]Unknown[/eluser]
Hi,
I am new to this Datatable library. While trying to use this library it returns me the entire result set instead of the subset of records. Can anyone please guide me on how to use it.

I am using CI version 2.2, datatable js version 1.10.2 and Datatable CI library version is 2.0 beta.

Thanks,
Hiren

[eluser]Unknown[/eluser]
Hi,

I am pretty new to the Ignited Datatables wrapper for Datatables (and new to this site). I have been using standard Datatables and Editor for close to half-a-year already but using Ignited Datatables is something I feel the need to use because of the way it can handle JOINs and Aggregate Functions that standard Datatables cannot perform. My question is, if it is possible to combine use of Ignited Datatables (the native PHP version at: https://github.com/n1crack/IgnitedDatata...hp-library) with Editor. I understand that this is a wrapper for Datatables, but if I wish to create an instance of Editor on Ignited Datatables, how do I initialize?

This is the code I used for creating an instance of a Datatable using Ignited Datatables:

ajax.php
Code:
require_once('IgnitedDatatables.php');
$datatables = new Datatables('mysqli');

$datatables
->select('DATE_FORMAT(TestRequestMain.TestRequestDateTime, "%Y-%m-%d") as trDate')
->select('ProjectMain.Name as prjName')
->select('POnumberMain.POnumber as poNum')
->select('AssignedGroup.Name as grpName')
->select('ProfitCenterMirror.Name as profitCenter')
->select('RegionMirror.Name as regName')
->select('TestRequestMain.TestTitle as trTitle')
->select('POnumberMain.TotalMandayReq as TotalMandayReq, POnumberMain.TotalMandayReq * POnumberMain.CostRate as totalCostAppr')
->select('(SUM(Schedule.ManHrsNM) + SUM(Schedule.ManHrsOT) + SUM(Schedule.ManHrsOTSunPH))/8 as totalMandayUsed, (SUM(Schedule.ManHrsNM) + SUM(Schedule.ManHrsOT) + SUM(Schedule.ManHrsOTSunPH))/8 * POnumberMain.CostRate as totalCostPaid, (POnumberMain.TotalMandayReq * POnumberMain.CostRate) - ((SUM(Schedule.ManHrsNM) + SUM(Schedule.ManHrsOT) + SUM(Schedule.ManHrsOTSunPH))/8 * POnumberMain.CostRate) as totalCostBalance')
->select('POnumberMain.QuoteNum as quoNum')
->select('POStatusMirror.String as poStatus')
->select('POnumberMain.DateStart as DateStart, POnumberMain.DateEnd as DateEnd, POnumberMain.DateClosed as DateClosed, POnumberMain.Remarks as Remarks,POnumberMain.CostRate as CostRate,POnumberMain.ProjectID as prjID')
->from('POnumberMain')
->join('ProjectMain', 'POnumberMain.ProjectID = ProjectMain.ID', 'left')
->join('TestRequestMain', 'POnumberMain.POnumber = TestRequestMain.POpoNumber', 'left')
->join('Schedule', 'TestRequestMain.TestRequestNo = Schedule.TestRequestNo', 'left')
->join('AssignedGroup', 'POnumberMain.OutsourceGroupID = AssignedGroup.ID', 'left')
->join('ProfitCenterMirror', 'POnumberMain.ProfitCenterID = ProfitCenterMirror.ID', 'left')
->join('RegionMirror', 'POnumberMain.RegionID = RegionMirror.ID', 'left')
->join('POStatusMirror', 'POnumberMain.POStatusID = POStatusMirror.ID', 'left');

echo $datatables->generate();

main_page.php
Code:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
&lt;html&gt;
&lt;head&gt;
&lt;meta http-equiv="content-type" content="text/html; charset=utf-8" /&gt;
&lt;link rel="shortcut icon" type="image/ico" href="http://www.datatables.net/media/images/favicon.ico" /&gt;
&lt;title&gt;Ignited DataTables example&lt;/title&gt;

&lt;link rel="stylesheet" type="text/css" href="css/jquery.dataTables.css"&gt;

[removed][removed]
[removed][removed]
[removed]
$(document).ready(function()
  {
    $('#example').dataTable
    ({
      'bServerSide'    : true,
      'sAjaxSource'    : 'ajax.php'
    });
  });
[removed]
&lt;/head&gt;
&lt;body id="dt_example"&gt;
<div id="container">
<h1>Ignited Datatables - Testing</h1>
  <table border="0" cellpadding="4" cellspacing="0" class="display" id="example">
    <thead>
      <tr>
        <th>Request Date</th>
  <th>Project Name</th>
  <th>Razer PO Number</th>
  <th>Outsource Test Hse</th>
  <th>Profit Center</th>
  <th>Region</th>
  <th>Test Request Title</th>
  <th>Total Manday Req.</th>
  <th>Total Approved Cost</th>
  <th>Used Manday</th>
  <th>Total Paid Cost</th>
  <th>Total Balance Cost</th>
  <th>Invoice Number</th>
  <th>PO Status</th>
  <th>Date Start</th>
  <th>Date End</th>
  <th>Date Closed</th>
  <th>Remarks</th>
  <th>Outsource Cost Per Manday</th>
  <th>Project ID (Hidden)</th>
      </tr>
    </thead>
    <tbody>
      <tr>
        <td>loading...</td>
      </tr>
    </tbody>
  </table>
</div>
&lt;/body&gt;
&lt;/html&gt;

[eluser]Unknown[/eluser]
Hello guys!!

3 days were passed and I could not solve my problem with the this awesome library.

I have a view with the table that will be load by a method. The JSON is ok, it's valid and if I check the firebug I can see the data changing if I search for a data.

Well, let me past the code.

VIEW:

Code:
<table id="tabela_estados" border="1" cellpadding="2" cellspacing="1" class="table table-striped table-bordered table-hover">
     <thead>
        <th>A</th>
        <th>B</th>    
        <th>C</th>
     </thead>
<table>
            [removed]
                     $(document).ready(function ()
                     {
                          var oTable = $("#tabela_estados").DataTable({
                               "bProcessing": true,
                               "bServerSide": true,
                               "sServerMethod": "POST",
                               "sAjaxSource": "/inicio/carrega_estados",
                               "bJQueryUI": true,
                               "bDeferRender": true,
                               "sPaginationType": "full_numbers",
                               "iDisplayStart ": 10,
                               "aoColumns": [
                                    {"sName": "id"},
                                    {"sName": "nome"},
                                    {"sName": "uf"}
                               ],
                               "oLanguage": {
                                    "sProcessing": ""
                               },
                               "fnServerData": function (sSource, aoData, fnCallback) {
                                    $.ajax
                                              ({
                                                   "dataType": "JSON",
                                                   "type": "POST",
                                                   "url": sSource,
                                                   "data": aoData,
                                                   "success": fnCallback
                                              });
                               }
                          });
                     });
            [removed]

Controller

Code:
function carrega_estados()
{
        $this->datatables
                ->select("id, nome, uf")
                ->from("estado");
        $data["json_response"] = $this->datatables->generate();
        $this->load->view("includes/v_response", $data);
}

VIEW: v_response
Code:
&lt;?php
echo json_response;

This is my JSON:

Code:

{"draw":0,"iTotalRecords":27,"iTotalDisplayRecords":27,"data":[["1","Acre","AC"],["2","Alagoas","AL"],["3","Amazonas","AM"],["4","Amapá","AP"],["5","Bahia","BA"],["6","Ceará","CE"],["7","Distrito Federal","DF"],["8","Espírito Santo","ES"],["9","Goiás","GO"],["10","Maranhão","MA"],["11","Minas Gerais","MG"],["12","Mato Grosso do Sul","MS"],["13","Mato Grosso","MT"],["14","Pará","PA"],["15","Paraíba","PB"],["16","Pernambuco","PE"],["17","Piauí","PI"],["18","Paraná","PR"],["19","Rio de Janeiro","RJ"],["20","Rio Grande do Norte","RN"],["21","Rondônia","RO"],["22","Roraima","RR"],["23","Rio Grande do Sul","RS"],["24","Santa Catarina","SC"],["25","Sergipe","SE"],["26","São Paulo","SP"],["27","Tocantins","TO"]],"sColumns":"id,nome,uf"}

If I set bServerSide = FALSE on the JS it only show "Loading..." (http://prntscr.com/4u64gn)

Informations:
Library version: 2.0
Jquery: 1.11
Datatable JS: 1.10.2

I don't know what to do, could anyone help me?




Theme © iAndrew 2016 - Forum software by © MyBB