Page 1 of 1

Setting button text changes height

Posted: Wed May 15, 2013 2:26 pm
by Dan Sweeney

I am changing the text on some buttons as the page loads using:

Tiggzi("mButDay1").text("Day 1 - Shoulders");

but it is then reducing the button height.

How can I make it keep the same size?

Thanks


Setting button text changes height

Posted: Wed May 15, 2013 2:34 pm
by Oleg Danchenkov

Hi Dan.
Try this
codeTiggzi("mButDay1").find('.ui-btn-text').text("Day 1 - Shoulders");/code


Setting button text changes height

Posted: Wed May 15, 2013 3:23 pm
by Dan Sweeney

That works great, thanks again


Setting button text changes height

Posted: Fri Mar 28, 2014 4:04 am
by Matt6607699

I tried running this in a mapped grid loop in order to target the button component. Each result is supposed to have a different value and the JS below will change the button color if the Value is "Connected"

if(value==="connected"){
$("a[dsid='connected_button2'] .ui-btn-text").css("background-image","linear-gradient(#15e109, #15e109)");
$("a[dsid='connected_button2'] .ui-btn-text").text("View Profile");
}else{
console.log("connection status is"+' '+value);
}

This just seems to change ALL the buttons to the same color and text, not each individually based on the values from the grid loop.
Is there a better way to target for a button in a loop for CSS Changes?
Thanks
Matt
Image Image


Setting button text changes height

Posted: Fri Mar 28, 2014 7:54 pm
by Nikita

Hello,

You can use this code:
$(element).css("background-image","linear-gradient(#15e109, #15e109)");
It'll allow refer to each button separately from the mapping