将数据表示例从select转换为input

时间:2015-03-03 19:22:41

标签: jquery

今晚我试了很久...... 我如何转换

http://live.datatables.net/ribezoho/20/edit

进入输入字段而不是选择选项值?

1 个答案:

答案 0 :(得分:0)

这将起作用

    var select = $('<input type="text" placeholder='+title+' value="" />')

替换行

    .on( 'change', function () {

    .on( 'keyup', function () {  // column will be searched dynamically on key press

    .search( val ? '^'+val+'$' : '', true, false ) 

    .search( $.trim(this.value) ) // search for string which is entered

并且不再需要

    column.data().unique().sort().each( function ( d, j ) {
        select.append( '<option value="'+d+'">'+d+'</option>' )
    } );