Individual Column Search

Individual Column Search

tsakaltsakal Posts: 15Questions: 6Answers: 0

Hi all there.

I have two links to test a problem In Individual Column Search.

The : http://tsakal.net/dt/test1.php Is working good.

The : http://tsakal.net/dt/test2.php has a problem In Individual Column Search. If, par examlpe, enter something In a column's search box, then It hangs or returns no data.

The only one diference, between two scripts, Is :

Language options Inside the working script ( https://datatables.net/examples/basic_init/language.html ) and

Language file Inside the erroneous one ( http://datatables.net/examples/advanced_init/language_file.html ), either local file or file from //cdn...

From the chrome's developer tool, when I Insert 222, In the first search box, I get ( the 222 Is value for every one sSearch_i parameter ) :

Remote Address:181.224.135.114:80
Request URL:http://tsakal.net/dt/test1datafromdb.php?sEcho=66&iColumns=16&sColumns=%2C%2C%2C%2C%2C%2C%2C%2C%2C%2C%2C%2C%2C%2C%2C&iDisplayStart=0&iDisplayLength=10&mDataProp_0=0&sSearch_0=222&bRegex_0=false&bSearchable_0=false&bSortable_0=false&mDataProp_1=1&sSearch_1=222&bRegex_1=false&bSearchable_1=true&bSortable_1=true&mDataProp_2=2&sSearch_2=222&bRegex_2=false&bSearchable_2=true&bSortable_2=true&mDataProp_3=3&sSearch_3=222&bRegex_3=false&bSearchable_3=true&bSortable_3=true&mDataProp_4=4&sSearch_4=222&bRegex_4=false&bSearchable_4=false&bSortable_4=false&mDataProp_5=5&sSearch_5=222&bRegex_5=false&bSearchable_5=false&bSortable_5=false&mDataProp_6=6&sSearch_6=222&bRegex_6=false&bSearchable_6=false&bSortable_6=false&mDataProp_7=7&sSearch_7=222&bRegex_7=false&bSearchable_7=true&bSortable_7=true&mDataProp_8=8&sSearch_8=222&bRegex_8=false&bSearchable_8=true&bSortable_8=true&mDataProp_9=9&sSearch_9=222&bRegex_9=false&bSearchable_9=true&bSortable_9=true&mDataProp_10=10&sSearch_10=222&bRegex_10=false&bSearchable_10=true&bSortable_10=true&mDataProp_11=11&sSearch_11=222&bRegex_11=false&bSearchable_11=true&bSortable_11=true&mDataProp_12=12&sSearch_12=222&bRegex_12=false&bSearchable_12=true&bSortable_12=true&mDataProp_13=13&sSearch_13=222&bRegex_13=false&bSearchable_13=true&bSortable_13=true&mDataProp_14=14&sSearch_14=222&bRegex_14=false&bSearchable_14=false&bSortable_14=false&mDataProp_15=15&sSearch_15=222&bRegex_15=false&bSearchable_15=false&bSortable_15=false&sSearch=&bRegex=false&iSortCol_0=3&sSortDir_0=desc&iSortCol_1=2&sSortDir_1=asc&iSortingCols=2&_=1425231465677
Request Method:GET
Status Code:200 OK
Request Headersview source
Accept:application/json, text/javascript, */*; q=0.01
Accept-Encoding:gzip, deflate, sdch
Accept-Language:el-GR,el;q=0.8,en;q=0.6
Connection:keep-alive
Host:tsakal.net
Referer:http://tsakal.net/dt/test2.php
User-Agent:Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/40.0.2214.115 Safari/537.36
X-Requested-With:XMLHttpRequest
Query String Parametersview sourceview URL encoded
sEcho:66
iColumns:16
sColumns:,,,,,,,,,,,,,,,
iDisplayStart:0
iDisplayLength:10
mDataProp_0:0
sSearch_0:222
bRegex_0:false
bSearchable_0:false
bSortable_0:false
mDataProp_1:1
sSearch_1:222
bRegex_1:false
bSearchable_1:true
bSortable_1:true
mDataProp_2:2
sSearch_2:222
bRegex_2:false
bSearchable_2:true
bSortable_2:true
mDataProp_3:3
sSearch_3:222
bRegex_3:false
bSearchable_3:true
bSortable_3:true
mDataProp_4:4
sSearch_4:222
bRegex_4:false
bSearchable_4:false
bSortable_4:false
mDataProp_5:5
sSearch_5:222
bRegex_5:false
bSearchable_5:false
bSortable_5:false
mDataProp_6:6
sSearch_6:222
bRegex_6:false
bSearchable_6:false
bSortable_6:false
mDataProp_7:7
sSearch_7:222
bRegex_7:false
bSearchable_7:true
bSortable_7:true
mDataProp_8:8
sSearch_8:222
bRegex_8:false
bSearchable_8:true
bSortable_8:true
mDataProp_9:9
sSearch_9:222
bRegex_9:false
bSearchable_9:true
bSortable_9:true
mDataProp_10:10
sSearch_10:222
bRegex_10:false
bSearchable_10:true
bSortable_10:true
mDataProp_11:11
sSearch_11:222
bRegex_11:false
bSearchable_11:true
bSortable_11:true
mDataProp_12:12
sSearch_12:222
bRegex_12:false
bSearchable_12:true
bSortable_12:true
mDataProp_13:13
sSearch_13:222
bRegex_13:false
bSearchable_13:true
bSortable_13:true
mDataProp_14:14
sSearch_14:222
bRegex_14:false
bSearchable_14:false
bSortable_14:false
mDataProp_15:15
sSearch_15:222
bRegex_15:false
bSearchable_15:false
bSortable_15:false
sSearch:
bRegex:false
iSortCol_0:3
sSortDir_0:desc
iSortCol_1:2
sSortDir_1:asc
iSortingCols:2
_:1425231465677

Please for an observation In my wrong situation.

Regards

Evangelos

This question has an accepted answers - jump to answer

Answers

  • allanallan Posts: 61,716Questions: 1Answers: 10,108 Site admin
    Answer ✓

    Try moving your event handler assignment into initComplete:

      initComplete: function () {
                    oTable.columns().eq( 0 ).each( function ( colIdx ) {
                        $( 'input', oTable.column( colIdx ).footer() ).on( 'keyup change', function () {
                            oTable
                                .column( colIdx )
                                .search( this.value )
                                .draw();
                        } );
                    } );
    }
    

    Allan

  • tsakaltsakal Posts: 15Questions: 6Answers: 0

    Thank you, solved.

    Sorry to disturbing your time, but I'm newbie in your environment.

    Thank you very much for your support.

    Regards

    Evangelos

  • allanallan Posts: 61,716Questions: 1Answers: 10,108 Site admin

    No worries - good to hear that helped.

    Allan

This discussion has been closed.