Quantcast
Channel: Recent Discussions — DataTables forums
Viewing all articles
Browse latest Browse all 82263

Search within input elements inside TD AND Newly added text to td html

$
0
0
I have an input text field inside the TD of my table. How can I get the search function of datatables to search the text inside those elements?

The TD looks like this:

<td class="dataCell   " id="view_pg:view_frm:data_pgblk:table_section:pgblk_table:1:j_id56" colspan="1">
<input id="view_pg:view_frm:data_pgblk:table_section:pgblk_table:1:noteOne" maxlength="80" name="view_pg:view_frm:data_pgblk:table_section:pgblk_table:1:noteOne" size="20" type="text">
 </td>

I am not sure if this is possible so I wrote some code that updates a hidden <p> in the TD with the value entered in the input

The problem is, it seem that data added to the table after initialized is not searched...

Any ideas how to get the search to look at newly updated data?

My initialization code is as follows:


$('[id$=pgblk_table]').dataTable( {
            
                "aoColumnDefs": [
                  { "bSearchable": false, "aTargets": [ 4 ] },
                  { "bSortable": false, "aTargets": [ 0,4 ] }
                                ],
                
                "aaSorting": [[7,'asc']],
                "iDisplayLength": 25,
                                
                                        
            }); 

Viewing all articles
Browse latest Browse all 82263

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>