Page 1 of 1
The select2('open') method was called on an element that is not using Select2
Posted: Wed Jun 05, 2024 6:02 pm
by guillerbm7
Hi! I'm migrating an small web from PHPMaker v2023 to v2024, but my filters won't work. When I click on them, nothing happens and the console returns me this:
The select2('open') method was called on an element that is not using Select2. select2.full.js:6481:20
jQuery 4
filter ew.js:5631
<anonymous> ew.js:10149
jQuery 8
<anonymous> CardRefresh.js:157
<anonymous> adminlte.min.js:6
<anonymous> adminlte.min.js:6
Anyone have some clue?
Re: Select2 error
Posted: Wed Jun 05, 2024 6:35 pm
by arbei
According to your error message, you are using Select2 in CardRefresh? Is it your own code or generated from original template? If latter, what is the page? A dashboard including a report with table head filter?
Re: Select2 error
Posted: Wed Jun 05, 2024 6:44 pm
by guillerbm7
It is a table list and I'm using a filter for some fields, it's not my code, it's generated. The filters don't work at all.
Re: Select2 error
Posted: Wed Jun 05, 2024 8:52 pm
by arbei
But there is no CardRefresh.js in List page for normal tables. You may post the complete error trace from the Console panel of your browser.
Re: Select2 error
Posted: Thu Jun 06, 2024 9:04 am
by arbei
arbei wrote:
You may post the complete error trace from the Console panel of your browser.
Press F12 in your browser, go to the Console panel, click the error, you'll see the complete stack trace, copy and post it here.
You may also see Copy stack trace.
Re: The select2('open') method was called on an element that is not using Select2
Posted: Thu Jun 06, 2024 4:11 pm
by guillerbm7
In my console there are 2 errors. The first one is the one I show above:
*The select2('open') method was called on an element that is not using Select2. select2.full.js:6481:20
jQuery 4
select2
each
each
select2
filter ew.js:5631
<anonymous> ew.js:10149
jQuery 8
dispatch
handle
(AsÃncrono: EventListener.handleEvent)
add
Le
each
each
Le
on
<anonymous> CardRefresh.js:157
<anonymous> adminlte.min.js:6
<anonymous> adminlte.min.js:6*
And the second one I think is consequence of the first one:
*Uncaught TypeError: can't access property "open", e is undefined
jQuery 4
select2
each
each
select2
filter ew.js:5631
<anonymous> ew.js:10149
jQuery 8
dispatch
handle
add
Le
each
each
Le
on
<anonymous> CardRefresh.js:157
<anonymous> adminlte.min.js:6
<anonymous> adminlte.min.js:6
select2.full.js:6487:10
jQuery 4
select2
each
each
select2
filter ew.js:5631
<anonymous> ew.js:10149
jQuery 8
dispatch
handle
(AsÃncrono: EventListener.handleEvent)
add
Le
each
each
Le
on
<anonymous> CardRefresh.js:157
<anonymous> adminlte.min.js:6
<anonymous> adminlte.min.js:6
*
Re: The select2('open') method was called on an element that is not using Select2
Posted: Thu Jun 06, 2024 8:11 pm
by arbei
The info is not more detailed than your first post. Anyway,
guillerbm7 wrote:
<anonymous> CardRefresh.js:157
The source code is:
$(document).on('click', SELECTOR_DATA_REFRESH, function (event) { // where SELECTOR_DATA_REFRESH = '[data-card-widget="card-refresh"]'
That means there was a click on a CardRefresh widget.
However, as said, there is no CardRefresh widget in normal table List page at all. CardRefresh is only used in dashboard report and login pages. That's why I asked if it is a dashboard report or your own code.
You better view the HTML source of your page in your browser and look for "CardRefresh", try to find out where the error orginated.
If you have added any customizations (not from the original template), you may want to elaborate.
Re: The select2('open') method was called on an element that is not using Select2
Posted: Mon Jun 10, 2024 10:05 pm
by guillerbm7
Hi again. The last couple of days I've been trying to find out where do CardRefresh came from or some clues about the error but without success. Yet, I've found an error that pops up when I open the code section of any table/view in the PHPMaker app. It says:
There was an error creating the controller. (2)
Error code: 0x80070002
Unexpected error result.
It may be that the .pmp file has been corrupted?
Re: The select2('open') method was called on an element that is not using Select2
Posted: Tue Jun 11, 2024 8:15 am
by arbei
That is irrelevant to JavaScript errors.
arbei wrote:
You better view the HTML source of your page in your browser and look for "CardRefresh", try to find out where the error orginated.
If you have added any customizations (not from the original template), you may want to elaborate.