Page 1 of 1
Change Text of A Button
Posted: Fri Aug 10, 2012 3:24 pm
by Emmz
Hey all...
When I change the text of a Tiggr placed button using
Tiggr('MyButton').text('NewText');
The Text is changed but the button becomes distorted. the btn icon is gone, size changes etc.
Example. I want to change the text on a button in the NavBar using custom JS
Thanks As always..
Change Text of A Button
Posted: Fri Aug 10, 2012 4:11 pm
by maxkatz
Change Text of A Button
Posted: Fri Aug 10, 2012 4:21 pm
by Emmz
On Click Event Tiggr('MyButton').text('NewText').button("refresh");
Ya Tried That. Gives error..Uncaught cannot call methods on button prior to initialization; attempted to call method 'refresh'
Ideas?
Change Text of A Button
Posted: Fri Aug 10, 2012 6:06 pm
by Emmz
On Click Event Tiggr('MyButton').text('NewText').button("refresh");
Ya Tried That. Gives error..Uncaught cannot call methods on button prior to initialization; attempted to call method 'refresh'
Ideas?
Change Text of A Button
Posted: Fri Aug 10, 2012 6:29 pm
by maxkatz
refresh only works on links styled as buttons:
[quote:]
The following methods apply only to form buttons. Link-based buttons do not have any associated methods.
[/quote]
http://jquerymobile.com/demos/1.1.1/d...
The button in Tiggzi is a link but with data-role="button" -- that's why the refresh won't work.
Change Text of A Button
Posted: Fri Aug 10, 2012 6:36 pm
by Emmz
OK.... So How Do I change the Text of said button ? Did I miss something in ur reply?
Change Text of A Button
Posted: Fri Aug 10, 2012 7:10 pm
by maxkatz
code
$("a[dsid='id'] .ui-btn-text").text("new text");
/code
http://stackoverflow.com/questions/40...
Change Text of A Button
Posted: Fri Aug 10, 2012 7:41 pm
by Emmz
Awesome ! As always...
I just realized that these custom JS questions are not really within the Scope
of Tiggzi App builder. While they provide more functionality, I'm sure you don't want to get into JQUERY training just because Tiggzi provides Custom Javascript capabilities! Its That very feature which makes Tiggzi stand out .
I always research my questions b4 posting. But will Keep the JS stuff to a minimum. You Have an excellent product and I'm very pleased with the service
Regards
Change Text of A Button
Posted: Tue Jun 11, 2013 6:12 am
by Yves Senn