Single column searching

Single column searching

ureshpatel5ureshpatel5 Posts: 25Questions: 0Answers: 0
edited July 2013 in General
Respected,
I used the * File: jquery.dataTables.min.js * Version: 1.9.4....
In my data listing tables.I put a search box that search using all columns.
I would like to implement such a thing like ,filter only fixed columns which i mention.
Can any one help ?
I try with this code but not working.I have four columns in list view.
[code]
jQuery(document).ready( function() {
jQuery('#DataTables_Table_0').dataTable( {
"bRetrieve":true,
"aoColumns": [
{ "bSearchable": false }
] } );
} );
[/code]

Replies

  • ureshpatel5ureshpatel5 Posts: 25Questions: 0Answers: 0
    edited July 2013
    I also try with this.
    [code]
    jQuery('#example').dataTable( {
    "bRetrieve": true,
    "aoColumnDefs": [
    { "bSearchable": false, "aTargets": [ 0,1,2,3 ] }
    ] } );
    [/code]
    Not working
  • allanallan Posts: 63,512Questions: 1Answers: 10,472 Site admin
    Please link to a test case: http://datatables.net/forums/discussion/12899/post-test-cases-when-asking-for-help-please-read

    It would also be worth reading the bRetrieve documentation if you haven't already and the table already exists (I don't know without a test case):

    > Retrieve the DataTables object for the given selector. Note that if the table has already been initialised, this parameter will cause DataTables to simply return the object that has already been set up - ***it will not take account of any changes you might have made to the initialisation object passed to DataTables*** (setting this parameter to true is an acknowledgement that you understand this).

    Allan
  • ureshpatel5ureshpatel5 Posts: 25Questions: 0Answers: 0
    edited July 2013
    Hey Allan,

    [quote] http://live.datatables.net/ategag/edit#javascript,html,live [/quote]

    if i do not put bRetrive= true then this error occurs.
    [code]
    DataTables warning (table id = 'example'): Cannot reinitialise DataTable.

    To retrieve the DataTables object for this table, pass no arguments or see the docs for bRetrieve and bDestroy
    [/code]
  • ureshpatel5ureshpatel5 Posts: 25Questions: 0Answers: 0
    Ok,i got your point.
    ok what about this solution shown in image below ? I think left matching search is the issue.what read in forum in data tables.
    http://i44.tinypic.com/2vb2zcz.png
  • allanallan Posts: 63,512Questions: 1Answers: 10,472 Site admin
    There is no 'solution' for that using the built in filter - that is how it is designed to work. If you want to change how it works you can use the fnFilter API method with a regular expression to match the word.

    Allan
  • ureshpatel5ureshpatel5 Posts: 25Questions: 0Answers: 0
    Allan,
    If try to modify the JS then...will be good ????
This discussion has been closed.