• Davide Buoso
  • NEWBIE
  • 5 Points
  • Member since 2018


  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 1
    Likes Given
  • 1
    Questions
  • 1
    Replies
I'm trying to dynamically calculate the height of a list (<ul> element with <li> inside). 
The problem is if I navigate through the elements printed by 'CONSOLE LOG 1', I get  a specific height of the <li> (55 in my case), but the 'CONSOLE LOG 2' it gives me a different value of '33'. (even using the 'offsetHeight' attribute instead of 'clientHeight' I'm having the same problem).

How is this possibile?


({
    rerender: function (component, helper) {
        this.superRerender();
        // ***** CONSOLE LOG 1 *******
        console.log(component.getConcreteComponent().getElements());


        for (var i = 0; i < component.get('v.listOfSObjects').length && i < component.get('v.limitMobileIteration'); i++) {
             // ******* CONSOLE LOG 2 ********
             console.log(component.getConcreteComponent().getElements()[0].children.namedItem('ul-list').children.item(i).clientWidth);  
     
        }  
    }
})

Does anyone know of any easy methods to ignore case of a string literal doing a replace? For instance:

 

string a = 'one';

string b = 'OneTwoThree';

string c = b.replace(a,'Four');

 

The above replace would not work due to case sensitivity because string a = 'one' and not 'One'.

 

Is there some way of ignoring the case on string a?

Does anyone know of any easy methods to ignore case of a string literal doing a replace? For instance:

 

string a = 'one';

string b = 'OneTwoThree';

string c = b.replace(a,'Four');

 

The above replace would not work due to case sensitivity because string a = 'one' and not 'One'.

 

Is there some way of ignoring the case on string a?