(このトピックに関する多くの回答を見ましたが、この質問には当てはまりません。)
DataTables には、ユーザーが各列の上/下の三角形のアイコンをクリックして、昇順または降順で並べ替える機能があります。次のようにデータをロードしました
oTable.fnAddData( ["Bogus data","1,541,512","12.5%","0","0","0"]);
oTable.fnAddData( ["Bogus data","3,541,512","2.5%","0","0","0"]);
oTable.fnAddData( ["Bogus data","541,512","1.5%","0","0","0"]);
oTable.fnAddData( ["Bogus data","2,541,512","32.5%","0","0","0"]);
oTable.fnAddData( ["Bogus data","741,512","3.5%","0","0","0"]);
oTable.fnAddData( ["A Bogus data","41,512","1.5%","0","0","0"]);
oTable.fnAddData( ["Bogus data","2,541,512","12.5%","0","0","0"]);
oTable.fnAddData( ["Z Bogus data","1,541,512","12.5%","0","0","0"]);
oTable.fnAddData( ["Bogus data","3,541,512","2.5%","0","0","0"]);
oTable.fnAddData( ["La Bogus data","541,512","1.5%","0","0","0"]);
oTable.fnAddData( ["The Bogus data","2,541,512","32.5%","0","0","0"]);
oTable.fnAddData( ["Bogus data","741,512","3.5%","0","0","0"]);
oTable.fnAddData( ["Bogus data","41,512","1.5%","0","0","0"]);
oTable.fnAddData( ["Bogus data","2,541,512","12.5%","0","0","0"]);
oTable.fnAddData( ["Bogus data","1,541,512","12.5%","0","0","0"]);
oTable.fnAddData( ["Bogus data","3,541,512","2.5%","0","0","0"]);
oTable.fnAddData( ["Bogus data","541,512","1.5%","0","0","0"]);
oTable.fnAddData( ["Bogus data","2,541,512","32.5%","0","0","0"]);
oTable.fnAddData( ["Bogus data","741,512","3.5%","0","0","0"]);
oTable.fnAddData( ["Bogus data","41,512","1.5%","0","0","0"]);
列番号 2 では、上向き/下向きの三角形をクリックすると、数値がアルファベット順に処理されます。文字を数字として扱い、2列目の上/下矢印が適切な方法でトリガーされるように調整するにはどうすればよいですか。次の初期化を使用してみました:
oTable = $('.utable').dataTable( {
"aoColumns": [{ sWidth: '60%' },{sWidth: '30%', "sType": "numeric"},{ sWidth: '10%' }],
"sDom": 'rt',
"sScrollY":"200px",
"bPaginate":false,
"bFilter":false,
"bInfo": false});
これは列をロックするだけで、その列のヘッダーで上/下アイコンは機能しません。