Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- jQuery('#' + _target).each(function () {
- var $table = jQuery(this);
- var i = 0;
- jQuery('th', $table).each(function (column) {
- if (jQuery(this).find("input")) {
- dataTypes[i] = { "sSortDataType": "input" }
- }
- else {
- dataTypes[i] = { "sSortDataType": "html" }
- }
- i++;
- });
- });
- dataTypes = $('#' + _target + ' th').map(function(i, th) {
- var $table = $(th).closest('table');
- var pos = $table.index(th) + 1;
- return { "sSortDataType": $table.find('td:nth-child('+pos+')').is(':has(input)') ? 'input' : 'html' };
- });
- dataTypes = $('#' + _target + ' th').map(function(pos, th) {
- return { "sSortDataType": $(th).closest('table').find('td:nth-child('+(pos+1)+')').is(':has(input)') ? 'input' : 'html' };
- });
- if (jQuery(this).is(":has(input)")) {
- dataTypes = jQuery('th', $table).map(function () {
- if (jQuery(this).is(":has(input)"))
- return { "sSortDataType": "input" };
- else
- return { "sSortDataType": "html" };
- }).get();
- var thMatches = $('#' + _target + ' th');
- var thCount = thMatches.length;
- var thCountWithInputs = thMatches.find('input').length;
- jQuery('#' + _target).each(function () {
- var $table = jQuery(this);
- var i = 0;
- jQuery('th', $table).each(function (column) {
- if ($('tbody > tr').find('td:nth-child(' + (column+1) + ')')
- .has('input')
- .length) {
- dataTypes[i] = { "sSortDataType": "input" }
- }
- else {
- dataTypes[i] = { "sSortDataType": "html" }
- }
- i++;
- });
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement