aha no nevadi...ale toto mi perfektne staci
este jedna chyba tam je...trocha to je spomalene v mozzile (aj chrome to iste)...akoby ten counting prebiehal dlhsie ako v opere ...nevies preco ??...
takto to mam teraz a ide to super okrem toho zpomalenia v mozile..
(ak tam hocikde nieco vidis co mam zle tak povedz)
Kód:
<script type="text/javascript">
var time = 0;
var t;
var filtering = 0;
var use_time = 700;
function checkFilter(){
$("input[type=checkbox].filter").bind('change', function(e) {
var formName = String(e.target.form.name);
useFilter(formName);
clearTimeout(t);
filtering = 0;
});
$("select.filter").bind('change', function(e) {
var formName = String(e.target.form.name);
useFilter(formName);
clearTimeout(t);
filtering = 0;
});
$("input[type=text].filter").bind('keyup', function(e) {
var formName = String(e.target.form.name);
time = 0;
if(!filtering){
filtering = 1;
timedCount(formName);
}
});
}
function timedCount(formName){
time = time+1;
t = setTimeout("timedCount('"+formName+"')", 1);
if(time==use_time){
useFilter(formName);
clearTimeout(t);
filtering = 0;
}
}
function useFilter(button){
$(document).ready(function() {
button = String(button);
showLoading();
$.ajax({
type : 'POST',
url: 'site.php/'+button+'/filter',
dataType : 'json',
data : $("form").serialize(),
success : function(data){
if (data.error === true){
buildAlert('warning', data.msg);
$("#output").slideDown();
}else{
$("#table_"+button+" tr.filtered").hide();
for(x in data.y){
$("#table_"+button+" tr#nr-"+data.y[x]).show();
}
if (data.info !== null){
buildAlert('info', data.info);
}
}
hideLoading();
},
error : function(XMLHttpRequest, textStatus, errorThrown) {
alert("chyba");
hideLoading();
}
});
return false;
});
}
</script>
// pridané po 39 sekundách od posledného príspevkuokey Ďuri ...pohľadam