Last active
December 25, 2015 19:19
-
-
Save timelyportfolio/7026976 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script> | |
jQuery.fn.dataTableExt.oSort['string_ignore_null-asc'] = function(x,y) { | |
if (x == null && y == null) return ((x < y) ? 1 : ((x > y) ? -1 : 0)); | |
if (x == null) return 1; | |
if (y == null) return -1; | |
return ((x < y) ? -1 : ((x > y) ? 1 : 0)); | |
}; | |
jQuery.fn.dataTableExt.oSort['string_ignore_null-desc'] = function(x,y) { | |
if (x == null && y == null) return ((x < y) ? 1 : ((x > y) ? -1 : 0)); | |
if (x == null) return 1; | |
if (y == null) return -1; | |
return ((x < y) ? 1 : ((x > y) ? -1 : 0)); | |
}; | |
</script> | |
<script type="text/javascript" charset="utf-8"> | |
var chartParams{{{ chartId }}} = {{{ chartParams }}} | |
$('#' + chartParams{{{ chartId }}}.id).removeClass("rChart") | |
$(document).ready(function() { | |
drawDataTable(chartParams{{{ chartId }}}) | |
}); | |
function drawDataTable(chartParams){ | |
var dTable = $('#' + chartParams.dom).dataTable( | |
chartParams.table | |
); | |
//first use rCharts width | |
$('#'+chartParams.id+"_wrapper").css("width",chartParams.width) | |
$('#'+chartParams.id+"_wrapper").css("width",chartParams.table.width) | |
//then if specified change to table width | |
$('#'+chartParams.id+"_wrapper").css("margin-left", "auto"); | |
$('#'+chartParams.id+"_wrapper").css("margin-right", "auto"); | |
dTable.fnAdjustColumnSizing(); | |
} | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment