1
Bug Report / Re: Listener bug in v10.1.0
« on: November 20, 2024, 07:36:09 pm »
Also just to mention, if I just set the "keydown" listener, the "timeout" normal course of things stops being triggered
This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.
var text_listener = {
"keydown": function(e, ui)
{
if(e.key==="Enter")
do_filter(ui);
},
// If I comment out below for v10.0.1 there are no wrong filter triggers
"timeout": function(e, ui){
do_filter(ui);
}
};
function do_filter(ui)
{
var rule = { condition: ui.column.filter.crules[0].condition, dataIndx: ui.column.dataIndx, value: ui.value, value2: ui.value2 },
CM = $("#grid").pqGrid("getColModel");
// Check if the filter is not already applied
for(var i=0, len = CM.length; i < len; i++){
// If there is no change
if( CM[i]["dataIndx"]===ui.column.dataIndx && ui.value===CM[i]["filter"]["crules"][0]["value"] && ui.value2===CM[i]["filter"]["crules"][0]["value2"] )
rule = null;
}
// If we have a rule, apply it
if(rule)
$("#grid").pqGrid("filter", {
oper: "add",
rules: [
rule
]
});
}
...
columnModel = [
{dataIndx:"NAME", title:"NAME", filter:{crules:[{condition:"contain"}], style:"text-align:"+dir, listener:text_listener}},
...
];
var text_listener = {
"keydown": function(e, ui)
{
if(e.type==="keydown" && e.key==="Enter")
do_filter(ui);
},
// If I comment out below for v10.0.1 there are no wrong filter triggers
"timeout": function(e, ui){
if(e.type==="timeout")
do_filter(ui);
}
};
<nav class="navbar navbar-default" style="position:sticky; top:0;">
var that=this,
jq = $("<span>", {html"O"})
.click(function(e){ that.do_something(this); })
.data("dta", {"id":2, "name":"O"})
.add(
$("<span>", {html"X"})
.click(function(e){ that.do_something_else(this); })
.data("dta", {"id":2, "name":"O"})
);
return {jquery: jq};
var rule = { condition: ui.column.filter.crules[0].condition, dataIndx: ui.column.dataIndx, value: ui.value, value2: ui.value2 },
CM = this.grid.pqGrid("getColModel");
// Check if the filter is not already applied
for(var i=0, len = CM.length; i < len; i++){
// If there is no change
if( CM[i]["dataIndx"]===ui.column.dataIndx && ui.value===CM[i]["filter"]["crules"][0]["value"] && ui.value2===CM[i]["filter"]["crules"][0]["value2"] )
rule = null;
}
// If we have a rule, apply it
if(rule)
this.grid.pqGrid("filter", {
oper: "add",
rules: [
rule
]
});
(function($) {
var fn = $.paramquery._pqGrid.prototype;
fn.showLoading = function() {
if(this.$grid_center.is(":visible"))
{
this.loading = true;
open_loading_overlay();
}
};
fn.hideLoading = function() {
this.loading = false;
close_loading_overlay();
};
})(jQuery);
calcTopBottom: function(left) {
if(typeof(this.dims)==="undefined") return 0;
...
getTop: function(ri, actual) {
var top = this.topArr ? this.topArr[ri] : 0,
...
getLeft: function(_ci, actual) {
if(typeof(this.leftArr)==="undefined") return 0;
...