DataTables logo DataTables

Trouble sorting on column with a hyperlink
  • fireeyesfireeyes
    Posts: 1
    Hi All,

    I'm a relatively new tabletools developer ... I'm having some trouble figuring out how to handle a sort on a column that includes a hyperlink. I've setup this little demo ... the one without the hyperlink sorts ok. Can anyone tell me where my error is?

     // Using aoColumnDefs
       $(document).ready(function() {
         $('.reporttable').dataTable({
    		        "iDisplayLength": 100,
                    "bStateSave": true,
                    "sDom": '<"toolbar">lTfrtip',
                    "sPaginationType": "full_numbers",
    				"aoColumnDefs": [ 
    				  { "sType": "html", "aTargets": ["fact"] },
                      { "sType": "numeric", "aTargets": ["fact"] }
    				],
                    "oTableTools": {
                        "sSwfPath": "{% media_url 'swf/copy_cvs_xls_pdf.swf' %}",
                        "aButtons": [
                            {
                                "sExtends":    "collection",
                                "sButtonText": "Save",
                                "aButtons":    [ 
    				              {"sExtends": "csv", "sFieldBoundary": ''},
             		 	           "pdf" ]
                            }
                        ]
                    }
                });
       } );
       
     
    
    

    <table class="reporttable">
              <thead><tr><th class="fact">12W12</th></tr></thead>
              <tbody>
              <tr>
              <td class="fact"><a href="">9</a></td>               
              </tr>
              <tr>
              <td class="fact"><a href="">83</a></td>                           
              </tr>                   
              <tr>
              <td class="fact"><a href="">58</a></td>          
              </tr>                  
              <tr>
              <td class="fact"><a href="">1</a></td>                
              </tr>                   
              <tr>
              <td class="fact"><a href="">11</a></td>               
              </tr>
              </tbody>
             </table>
         
    
             <table class="reporttable">
             <thead><tr><th class="fact">12W12</th></tr></thead>
             <tbody>
             <tr>
             <td class="fact">2.23</td>
             </tr>
             <tr>
             <td class="fact">4.34355</td>
             </tr>
             <tr>
             <td class="fact">656.78</td>
             </tr>
             <tr>
             <td class="fact">66.78</td>
             </tr>
             <tr>
             <td class="fact">23.3</td>
             </tr>
             </table>
    

    http://live.datatables.net/emebaj
This discussion has been closed.
← All Discussions

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Support

Get useful and friendly help straight from the source.