Column Filter doesn't work with hyperlink?

Column Filter doesn't work with hyperlink?

cooldtcooldt Posts: 4Questions: 2Answers: 0
edited December 2014 in Free community support

In my datatable, I am using columnFilter add-on and first column (ID) data has hyperlink. Hyperlink navigates to expected page but filter for this particular column (ID) doesnt't work. Any help is much appreciated. Below is my code

    <script>

        var dataSetString = $('#hiddenData').attr('value');
        var dataSet = eval(dataSetString);

        $(document).ready(function() {

           var table = $('#example').dataTable( {

                "data": dataSet,
                "aoColumns": [
                            { "title": "Id"},
                            { "title": "Issue Date" },
                            { "title": "Expiry Date" },
                            { "title": "Area" }
                ],
                "columnDefs": [
                               //title column has hyperlinks
                               {
                                   "render": function ( data, type, row ) {
                                       return '<a href="#{request.contextPath}/module/misc/module/search/titleDetails.jsf?titleId=' + data + '"><i class="fa fa-external-link"></i> ' + data + '</a>' ;
                                   },
                                   "targets": 0
                               }
                ],
                "order": [[ 0, "desc" ]]
            } );

            table.columnFilter({ sPlaceHolder: "head:before",
                aoColumns: [ {type: "number"},
                             {type: "number"},
                             {type: "number"},
                             {type: "number"}


                           ]

            });

        } );

    </script>

This question has an accepted answers - jump to answer

Answers

  • cooldtcooldt Posts: 4Questions: 2Answers: 0
    edited December 2014

    This is a high priority for me. Could anyone help me please with the solution?

  • daniel_rdaniel_r Posts: 460Questions: 4Answers: 67
    Answer ✓

    You can check out my yadcf plugin for datatables, it got 10 types of diff' filters and plenty of features, go over the showcase and see if you find something that you need (docs are in the js file itself)

    http://yadcf-showcase.appspot.com/

  • cooldtcooldt Posts: 4Questions: 2Answers: 0

    Thanks for you help.
    Resolved it myself. Just change type to sType for that column

This discussion has been closed.