plugins/bootstrap/datatable.js
function standardizeCols(columns) {

	/**
	 * Gets the default column name
	 */
	function getDefaultFormatter(colName) {
		return function(o) {
			return o[colName];
		};
	}

	/**
	 * Gets the default column sorter
	 */
	function getDefaultSorter(colName) {
		return function(a, b, dir){

			var 
				firstRec = dir == 'asc' ? a : b,
				secondRec = dir == 'asc' ? b : a,

				fA = firstRec[colName].toLowerCase(),
				fB = secondRec[colName].toLowerCase();

			// Handle numbers
			if (fA<fB) return -1
			if (fA>fB) return +1
			return 0
		};
	}


	for (var i in columns) {
		var column = columns[i];

		if (typeof column == "string") {
			column = {name: column};
		}

		column.dir = column.sortDir || 'asc';
		column.formatter = column.formatter || getDefaultFormatter(column.key || column.name);
		column.sorter = column.sorter || getDefaultSorter(column.key || column.name);

		columns[i] = column;
	}
	return columns;
}
function standardizeCols(columns) {

	/**
	 * Gets the default column name
	 */
	function getDefaultFormatter(colName) {
		return function(o) {
			return o[colName];
		};
	}

	/**
	 * Gets the default column sorter
	 */
	function getDefaultSorter(colName) {
		return function(a, b, dir){

			var 
				firstRec = dir == 'asc' ? a : b,
				secondRec = dir == 'asc' ? b : a,

				fA = firstRec[colName].toLowerCase(),
				fB = secondRec[colName].toLowerCase();

			// Handle numbers
			if (fA<fB) return -1
			if (fA>fB) return +1
			return 0
		};
	}


	for (var i in columns) {
		var column = columns[i];

		if (typeof column == "string") {
			column = {name: column};
		}

		column.dir = column.sortDir || 'asc';
		column.formatter = column.formatter || getDefaultFormatter(column.key || column.name);
		column.sorter = column.sorter || getDefaultSorter(column.key || column.name);

		columns[i] = column;
	}
	return columns;
}
function standardizeCols ( columns ) { /**
	 * Gets the default column name
	 */ function getDefaultFormatter ( colName ) { return function ( o ) { return o [ colName ] ; } ; } /**
	 * Gets the default column sorter
	 */ function getDefaultSorter ( colName ) { return function ( a , b , dir ) { var firstRec = dir == 'asc' ? a : b , secondRec = dir == 'asc' ? b : a , fA = firstRec [ colName ] . toLowerCase ( ) , fB = secondRec [ colName ] . toLowerCase ( ) ; // Handle numbers if ( fA < fB ) return - 1 if ( fA > fB ) return + 1 return 0 } ; } for ( var i in columns ) { var column = columns [ i ] ; if ( typeof column == "string" ) { column = { name : column } ; } column . dir = column . sortDir || 'asc' ; column . formatter = column . formatter || getDefaultFormatter ( column . key || column . name ) ; column . sorter = column . sorter || getDefaultSorter ( column . key || column . name ) ; columns [ i ] = column ; } return columns ; }
Standardizes the column definitions
E.g., if the user passes a string for a column def, fill out the defaults
Standardizes the column definitions E . g . if the user passes a string for a column def fill out the defaults