是否可以使用jquery-multiselect此插件来处理此插件jquery-datatables中的搜索?我使用服务器端脚本生成表。但我需要使用jquery-multiselect插件进行数据表中的搜索。
加载表的代码是:
$(document).ready(function(){
url = 'lib/includes/load_table.php?text=test';
mytable = $('#article').dataTable({
oLanguage: {
'sUrl': 'lib/components/datatables/src/de_DE.js'
},
'bFilter': true,
'sPaginationType': 'full_numbers',
'bProcessing': true,
'bServerSide': true,
'sAjaxSource': 'lib/includes/load_table.php',
//'sDom' : '<"clear">tr'
});
});
load_table.php如下所示:
<?php
include('../common.php');
$output = array(
'sEcho' => intval($_GET['sEcho']),
'iTotalRecords' => 57,
'iTotalDisplayRecords' => 57,
'aaData' => array()
);
$limit = 10;
$elements = array();
$elements[] = array("", 1);
$test = array();
$query = "SELECT * FROM table LIMIT 0,".intval($_GET['iDisplayLength'])."";
$result = mysql_query($query);
while($row = mysql_fetch_array($result, MYSQL_ASSOC))
{
$test[] = array(
$row["werkstoff"],
$row["artikel"],
$row["aussendurchmesser_1"],
$row["wandstaerke_1"],
$row["aussendurchmesser_2"],
$row["wandstaerke_2"],
$row["norm"],
'<span class="currency">EUR</span> <span class="price">'.number_format($row["vkpreis"], "2", ",", "").'</span>',
$_form->clickboxes("radio", "form[zeugnis".$row["id_artikel"]."]", $elements),
$_form->clickboxes("radio", "form[zeugnis".$row["id_artikel"]."]", $elements),
$_form->clickboxes("radio", "form[zeugnis".$row["id_artikel"]."]", $elements),
'<i class="icon-question-sign"></i>',
$_form->text("text", "form[value".$row["id_artikel"]."]", "40px").'
<button class="button orange small shoppingcart" arID="'.$row["id_artikel"].'"><i class="icon-shopping-cart"></i></button>
<a href="'.modifyurl(ARTIKEL, "id=".$row["id_artikel"]."").'"><button class="button white small"><i class="icon-info-sign"></i></button></a>');
$output["aaData"] = $test;
}
echo $test = json_encode($output);
?>
这就是多选的外观:
<h4>Werkstoffe</h4>
<select class="multiselect" size="10">
<option value="">1</option>
<option value="">2</option>
<option value="">3</option>
</select>
</div>