Author Topic: On range filter with options getting a console error  (Read 100 times)

jplevene

  • Pro Ultimate
  • Full Member
  • *
  • Posts: 100
    • View Profile
On range filter with options getting a console error
« on: August 14, 2024, 07:36:09 pm »
It actually all works fine but there shouldn't be an error in the console.  Using remote data, when I select an option in the grid dropdown I get the attached error.

Code: [Select]
colModel: [...
{dataIndx:"DEPOT", width:100, halign:"center", title:"Depot",
filter: {
crules: [{condition:"range"}],
conditionList: ["range"],
options : [{"1":"London"}, {"2":"Manchester"}, {"3":"Birmingham"}],
gridOptions: {
stripeRows: false,
numberCell: {show: false},
filterModel: {header: false}
}
}
},
...]

I know I am filtering using integers, which is fine as that is what my server wants and this is remote data, so local ignores it

Code: [Select]
[
{"DEPOT":"London", ....},
{"DEPOT":"London", ....},
{"DEPOT":"Manchester", ....},
{"DEPOT":"London", ....},
{"DEPOT":"Birmingham", ....}
]

The error according to the console the error is here:

Code: [Select]
_pq._trigger = function(type, evt, data) {
var self = this,
prop, orig, this_listeners = self.listeners,
listeners = this_listeners[type],
o = self.options,
allEvents = o.allEvents,
bubble = o.bubble,
$ele = self.element,
callback = o[type];
data = data || {};
evt = $.Event(evt);
evt.type = self.widgetName + ":" + type;
evt.target = $ele[0];       // <<<<<<<<<<<<<<<---------- THIS LINE
orig = evt.originalEvent;
if (orig) {
for (prop in orig) {
if (!(prop in evt)) {
evt[prop] = orig[prop]
}
}
}
if (allEvents) {
if (pq.isFn(allEvents)) {
allEvents.call(self, evt, data)
}
}
if (listeners && listeners.length) {
handleListeners(self, listeners, evt, data);
if (evt.isImmediatePropagationStopped()) {
return !evt.isDefaultPrevented()
}
}
if (o.trigger) {
$ele[bubble ? "trigger" : "triggerHandler"](evt, data);
if (evt.isImmediatePropagationStopped()) {
return !evt.isDefaultPrevented()
}
}
if (callback) {
var ret = callback.call(self, evt, data);
if (ret === false) {
evt.preventDefault();
evt.stopPropagation()
}
}
listeners = this_listeners[type + "Done"];
if (listeners && listeners.length) {
handleListeners(self, listeners, evt, data)
}
return !evt.isDefaultPrevented()
};
« Last Edit: August 14, 2024, 07:39:58 pm by jplevene »

paramvir

  • Administrator
  • Hero Member
  • *****
  • Posts: 6263
    • View Profile
Re: On range filter with options getting a console error
« Reply #1 on: August 14, 2024, 08:09:00 pm »
Could you please share a jsfiddle / stackblitz

jplevene

  • Pro Ultimate
  • Full Member
  • *
  • Posts: 100
    • View Profile
Re: On range filter with options getting a console error
« Reply #2 on: August 14, 2024, 11:37:10 pm »
Starngest thing, when I do:

gridOptions: {
   ...
   check: function(e, ui){},
   ...
}

The error goes away, but nothing happens when I select an option

Do you have a jsFiddle or Stackblitz template link?
« Last Edit: August 14, 2024, 11:42:51 pm by jplevene »

paramvir

  • Administrator
  • Hero Member
  • *****
  • Posts: 6263
    • View Profile