我正在尝试更新我在函数外部.datatable()
函数的 Jquery 数据表中创建的自定义参数。
我通过以下方式创建了自定义参数:
var oTable = $('#reqAllQueriesTable')
.dataTable(
{
"bProcessing": true,
"bServerSide": true,
"sAjaxSource": "query/getQuery",
"bFilter" : true,
"bJQueryUI" : true,
"sSearch": "Search",
"sDom": '<"H"<"projectTeamTools">lrft>',
"fnServerData": function ( sSource, aoData, fnCallback ) {
aoData.push( { "name": "myParam", "value": "myValue" } );
$.ajax( {
"dataType": 'json',
"url": sSource,
"data": aoData,
"success": fnCallback
} );
}
});
$("div.projectTeamTools").html('Organize by Project Teams: <select id="projectTeams"><option value="1">Project Team</option><c:forEach var="projectTeam" items="${userProjectTeams}"><option value="${projectTeam.projectId}" onClick="javascript:onTeamSelect(this.value)">${projectTeam.projectName}</option></c:forEach></select>');
function onTeamSelect(teamId){
alert(teamId +" Selected");
//oTable.fnSettings().aoServerParams.push( { name: "aoTeamId", value: teamId } );
//I want to update the parameter `myParam` here.
//Or create a new parameter 'aoTeamId', whichever is possible.
}
这可能吗。请帮忙!
谢谢,桑米特。