Have an admin from that does not have fullordering select list
Clear button should clear the search field and reload the list of items
Nothing.
Tested on current J4 git.
If your admin form is using LayoutHelper::render('joomla.searchtools.default', array('view'=>$this)) in your view and your form does not have a select list named fullorderering the clear button onClick event gets cleared. This event is added in searchtools.js at line 175.
Further on at line 179 a call to function createOrderField is made. Within this function at line 440 a test is made to determine if this select list was found. If it was not found it is created.
The problem happens due to line 447 where the new orderField is appended to the form. The execution of this statement
this.theForm.innerHTML += this.orderField.outerHTML;
Causes the attached onClick of the Clear button to be dropped.
In the J3 version of this searchtools.js file the orderField is attached using the jQuery append which I gather does not cause this issue but I have not tested it.
Labels |
Added:
?
|
Build | staging | ⇒ | 4.0-dev |
Title |
|
Labels |
Added:
J4 Issue
|
Changing line 447 to the following solved the problem for me.
this.theForm.append(this.orderField);
I confirmed the orderField is actually appended as the last input field of the form.
@dgrammatiko Could you have a quick look on this issue? Is the change suggested here by the author right? If so, he or me can make a PR if you are too busy, and if not and you guide me the way, I can make one.
Seems legit
I don't currently have a repo set up to PR with so if someone else could PR it I would appreciate it.
Ok, thanks for reporting.
I will make a PR.
Closing as having a pull request. Please test #32396 . Thanks in advance, thanks @skurvish for reporting the issue and providing the right fix, and thanks @dgrammatiko for checking it.
Status | New | ⇒ | Closed |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2021-02-12 11:49:13 |
Closed_By | ⇒ | richard67 |
@skurvish Could you give the pull request #32396 for this issue a test? In your case, as you already have tested the fix, it is enough to verify that the PR only does what you have suggested, and then go to our issue tracker here https://issues.joomla.org/tracker/joomla-cms/32396 , use the "Test this" button, select the right test result and then submit. Thanks in advance.
Changing line 447 to the following solved the problem for me.
this.theForm.append(this.orderField);
I confirmed the orderField is actually appended as the last input field of the form.