如何让选择框显示列中的所有不同值?
这里有一个我需要的例子:
http://datatables.net/examples/api/multi_filter_select.html
选择框应填充DB列(或表格列)中的所有不同值 如何在添加模式窗口(来自DataTables Editor插件)中执行此操作?
这是一个应该这样做的脚本,但它对我不起作用: http://datatables.net/forums/discussion/comment/34461#Comment_34461
这是模态窗口JS脚本:
$(document).ready(function() {
editor = new $.fn.dataTable.Editor( {
"ajaxUrl": "php/browsers.php",
"domTable": "#example",
"fields": [
{"label": "Field 1","name": "field1","type": "select","ipOpts": [
{
"label": "Option 1",
"value": "option1" },
{
"label": "Option 2",
"value": "option2" },
{
"label": "Option 3",
"value": "option3" },
]
},
{"label": "Field 2","name": "field2","type": "select","ipOpts": [
{
"label": "Option 1",
"value": "option1" }
]},
]
} );