0

Hi below is my datatable java script,

 $('#Proj_emp_table').dataTable({

     "sAjaxSource": "/projects/project_json/",
      "fnServerData": function ( sSource, aoData, fnCallback, oSettings ) {
       oSettings.jqXHR = $.ajax( {
        "dataType": 'json',
        "type": "GET",
       "url": sSource,
       "data": aoData,
       "success": fnCallback
      } );
    }
   });

And my html is ,

 <table id='Proj_emp_table' class="display">
    <thead>
    <tr>
        <th>Employee ID</th>
        <th>Employee Name</th>
        <th>Experience Prior to ASM</th>
        <th>Joining Date</th>
        <th>Asm Experience</th>
        <th>Billing Start Date</th>
        <th>Bill Status</th>
    </tr>
    </thead>
    <tbody>
        <tr>
          <td></td>
        </tr>
    </tbody>
     <tfoot>
        <tr>
        <th>Employee ID</th>
        <th>Employee Name</th>
        <th>Experience Prior to ASM</th>
        <th>Joining Date</th>
        <th>Asm Experience</th>
        <th>Billing Start Date</th>
        <th>Bill Status</th>
        </tr>
     </tfoot>
    </table>

Here my ajax request works fine and i am getting the json data properly and table is also formed. But how to add hyperlink to the a column.

Eg: Employee name column should have a hyperlink which should go to page like /employee/ID/

Here ID should be picked up from the json data itself that is my 1st field.

Naggappan Ramukannan
  • 2,564
  • 9
  • 36
  • 59

1 Answers1

-1

The data you are sending it back will include the <a href> code

user3036342
  • 1,023
  • 7
  • 15
  • No it won't if the server sided code does not prepare it for having a href. @Robert Rozas is right. – mainguy Jun 24 '14 at 14:12
  • Really? Weird, because this is EXACTLY how I implemented it and it's working fine. Even for textboxes and checkboxes. But if you say it won't work, then fine. I'm just TELLING YOU WHAT WORKS – user3036342 Jun 25 '14 at 07:00
  • Too bad that the OP doesn't have your awesome system. Could have spared him the question. – mainguy Jun 25 '14 at 09:37