As title says
TypeError: self.getAttribute is not a function in searchtools.js 145:29
Labels |
Added:
?
|
Labels |
Added:
J4 Issue
Removed: ? |
Status | New | ⇒ | Discussion |
Category | ⇒ | JavaScript |
hmm
using npm install with a modified searchtools.es6.js where I have
const newOrderCol = this.getAttribute('data-order');
const newDirection = this.getAttribute('data-direction');
creates a searchtools.js with
var newOrderCol = _this.getAttribute('data-order');
var newDirection = _this.getAttribute('data-direction');
I.e. an underscore is added...
although we have in the es6 file
const self = this;
self does not work either.
@dgrammatiko
I am lost
This should work:
item.addEventListener('click', (event) => {
// Order to set
const newOrderCol = event.target.getAttribute('data-order');
const newDirection = event.target.getAttribute('data-direction');
const newOrdering = `${newOrderCol} ${newDirection}`;
Obviously this
is the class so it won't work on this case as we want to fetch the attributes of the element clicked. And obviously you have to blame me for this
That's it. making patch now.
Status | Discussion | ⇒ | Closed |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2018-08-10 13:43:58 |
Closed_By | ⇒ | infograf768 |
Could you reopen here pls. because the pr is closed without merging?
Status | Closed | ⇒ | New |
Closed_Date | 2018-08-10 13:43:58 | ⇒ | |
Closed_By | infograf768 | ⇒ |
Reopened as requested
Status | New | ⇒ | Discussion |
Status | Discussion | ⇒ | Closed |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2018-08-12 04:48:33 |
Closed_By | ⇒ | infograf768 |
Ok, found the culprit
code should be
will make patch