我正在尝试做一个任务,就像这个问题一样。
它让我找到了一个不错的插件。
http://datatables.net/plug-ins/api/fnSortNeutral
jQuery.fn.dataTableExt.oApi.fnSortNeutral = function ( oSettings )
{
/* Remove any current sorting */
oSettings.aaSorting = [];
/* Sort display arrays so we get them in numerical order */
oSettings.aiDisplay.sort( function (x,y) {
return x-y;
} );
oSettings.aiDisplayMaster.sort( function (x,y) {
return x-y;
} );
/* Redraw */
oSettings.oApi._fnReDraw( oSettings );
};
Run Code Online (Sandbox Code Playgroud)
但是我不知道“如何使它工作”。任何人都知道什么是“oApi”,或者在我使用这个插件之前我需要更多的设置吗?
因为我的脚本Uncaught TypeError: Cannot read property 'oApi' of undefined 在我复制脚本后立即出现,并且该错误使函数未定义。我该怎么办 ?
我尝试时使用mysql:
SELECT GROUP_CONCAT(score)
FROM DailyScore
WHERE team = '42'
AND Date IN('2013-08-01','2013-08-02','2013-08-03','2013-08-04')
Run Code Online (Sandbox Code Playgroud)
它将返回以下结果:
50,100,75
Run Code Online (Sandbox Code Playgroud)
因为第42队在'2013-08-02'没有得分
我希望我能得到:
50,,100,75
Run Code Online (Sandbox Code Playgroud)
我应该使用什么SQL查询?