Strange behavior of $ in stepper which it do not work properly

Hi, i have a f7 tempate which has a mounted() function,

with the following , code ,where I am trying to initialize the stepper with change event
listener,

app.on('stepperChange', function(stepper,value){
  var _itemLineTotal = value * 2 ;
  //then i tried to assign the value to one of the element with a known id 
  $('#item_screen_cart_total').innerHTML = _itemLineTotal.toString();
});

and the stepper is working and console record no errors,
but it is just not working! value can’t get assigned but when i go to the console,
and tried the same code

$('#item_screen_cart_total').innerHTML = 'some value 123';

it works. is there anything wrong with my code?
I appreciate for any input or help.

thanks.
kalmen

just find out, this works,

var _item_line_total_id = 'itemlinetotal'+ stepper.inputEl.dataset['id'] ;
var s = document.getElementById(_item_line_total_id);
s.innerHTML = (value * stepper.inputEl.dataset['price']).toString();

not sure why the $ selector is not working. but it is fine, as long as it works
for me.

The default variable for Dom7 (replacement for jQuery from Framework7 author) is $$ (double dollar sign) Maybe that makes a difference?

1 Like