Emmz
Posts: 0
Joined: Sat Jun 23, 2012 11:06 pm

Change Text of A Button

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..

maxkatz
Posts: 0
Joined: Fri Aug 13, 2010 3:24 pm

Change Text of A Button

Try doing a refresh on the button:

http://jquerymobile.com/demos/1.1.1/d...

Emmz
Posts: 0
Joined: Sat Jun 23, 2012 11:06 pm

Change Text of A Button

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?

Emmz
Posts: 0
Joined: Sat Jun 23, 2012 11:06 pm

Change Text of A Button

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?

maxkatz
Posts: 0
Joined: Fri Aug 13, 2010 3:24 pm

Change Text of A Button

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.

Emmz
Posts: 0
Joined: Sat Jun 23, 2012 11:06 pm

Change Text of A Button

OK.... So How Do I change the Text of said button ? Did I miss something in ur reply?

maxkatz
Posts: 0
Joined: Fri Aug 13, 2010 3:24 pm

Change Text of A Button

code
$("a[dsid='id'] .ui-btn-text").text("new text");
/code

http://stackoverflow.com/questions/40...

Emmz
Posts: 0
Joined: Sat Jun 23, 2012 11:06 pm

Change Text of A Button

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

Yves Senn
Posts: 0
Joined: Tue May 21, 2013 4:46 am

Change Text of A Button

works like a charm

Return to “Issues”