Lines 852-879
var KeepConditions = (function () {
Link Here
|
852 |
|
852 |
|
853 |
// Check if condition is setup on table |
853 |
// Check if condition is setup on table |
854 |
isInit: function isInit() { |
854 |
isInit: function isInit() { |
855 |
return typeof _parent._dtSettings.oInit.searching === 'undefined' || _parent._dtSettings.oInit.searching !== false; |
855 |
return true; // FIXME |
|
|
856 |
//return typeof _parent._dtSettings.oInit.searching === 'undefined' || _parent._dtSettings.oInit.searching !== false; |
856 |
}, |
857 |
}, |
857 |
|
858 |
|
858 |
// Function to check if a condition exists in the hash, and to process it |
859 |
// Function to check if a condition exists in the hash, and to process it |
859 |
onLoad: function onLoad(hashComponent) { |
860 |
onLoad: function onLoad(hashComponent) { |
860 |
if (typeof hashComponent !== 'undefined' && _parent._dtApi.search() !== decodeURIComponent(hashComponent)) { |
861 |
if (typeof hashComponent !== 'undefined' ) { |
861 |
_parent._dtApi.search(decodeURIComponent(hashComponent)); |
862 |
var filters = JSON.parse(decodeURIComponent(hashComponent)); |
|
|
863 |
var global_filter = filters['f']; |
864 |
var column_filters = filters['cf']; |
865 |
var table_dt = $(_parent._dtApi.table); |
866 |
_parent._dtApi.search(global_filter); |
867 |
$.each(column_filters, function(i, v){ |
868 |
if ( v != "" ) { |
869 |
$(table_dt).find('thead tr:eq(1) th:eq('+i+') input').val(v); |
870 |
//_parent._dtApi.column(i).search(v).draw(); |
871 |
_parent._dtApi.column(i).search(v); |
872 |
} |
873 |
}); |
874 |
|
862 |
_parent._shouldDraw = true; |
875 |
_parent._shouldDraw = true; |
863 |
} |
876 |
} |
864 |
}, |
877 |
}, |
865 |
|
878 |
|
866 |
// Check if a value for this condition is currently set for the table (and not at default) |
879 |
// Check if a value for this condition is currently set for the table (and not at default) |
867 |
isset: function isset() { |
880 |
isset: function isset() { |
868 |
return _parent._dtApi.search().length !== 0; |
881 |
return true; // FIXME |
|
|
882 |
//return _parent._dtApi.search().length !== 0; |
869 |
}, |
883 |
}, |
870 |
|
884 |
|
871 |
// Return the new value to be stored in the hash for this conditions component |
885 |
// Return the new value to be stored in the hash for this conditions component |
872 |
newHashVal: function newHashVal() { |
886 |
newHashVal: function newHashVal() { |
873 |
return encodeURIComponent(_parent._dtApi.search()); |
887 |
var global_filter = _parent._dtApi.search(); |
|
|
888 |
var column_filters = []; |
889 |
_parent._dtApi.columns().search().each(function(v,i){ |
890 |
column_filters.push(this[i]); |
891 |
}); |
892 |
return encodeURIComponent(JSON.stringify({'f': global_filter, 'cf': column_filters })); |
874 |
} |
893 |
} |
875 |
}, |
894 |
}, |
876 |
|
|
|
877 |
/** |
895 |
/** |
878 |
* Condition: Length |
896 |
* Condition: Length |
879 |
* |
897 |
* |