0
問題是如何在表內創建selectpicker。我有休息API,我的價值觀到我的桌子。但我的桌子必須有selectpicker
加入。我不知道如何管理這個。 selectpicker包含來自rest api的值。 這就是我想要把selecpicker:jQuery datatables row selectpicker
{ "sCellType": "select", "sClass": "selectpicker","data":'<option>'+"status"+'</option>'}
我的jQuery代碼看起來像:
function get_all(){
$('#data_table_out_mix').dataTable({
"dom": '<"top"fi>rt<"bottom"lp><"clear">',
"iDisplayLength": 5,
"processing": true,
"serverSide": true,
"ajax":{
url:'/out_invo_all/'
},
"columns": [
{ "data": "invoice_number" },
{ "data": "customer" },
{ "data": "date" },
{ "data": "due_date" },
{ "data": "total_invoice_amount" },
{ "sCellType": "select", "sClass": "selectpicker","data":'<option>'+"status"+'</option>'},
{"defaultContent": '<img style="cursor:pointer" class="img-responsive CloneRow" src="../static/izibizi/images/forms/icon_duplicate.png">'},
{"defaultContent": '<img id = "obrisi" data-toggle="modal" data-target="#OutgoingInvo" style="cursor:pointer" class="img-responsive OutgoingInvo" src="../images/forms/icon_delete.png">'},
]
});
}
如果你culd給我一些這方面的建議。
非常感謝你的這種接受。 @JAG – marin
@marin - 你想在你的DataTables初始化中使用selectpicker bootstrap插件嗎?這就是我正在做的,但是當我初始化DataTable上的搜索功能時,它會將selectPicker類從select中刪除。你碰到過嗎? – Hill