Andrés Méndez
Posts: 0
Joined: Thu Apr 18, 2013 6:13 pm

Dynamic header

Hello.

I want to put the text header based on a data from database.

I have tried to put a Label inside the header, but it doesn't allow me to do that.

How can I do that?

Thanks.

Maryna Brodina
Posts: 0
Joined: Thu Apr 05, 2012 7:27 am

Dynamic header

Hello! It's not possible to add label to header, but you can change any component using JS including header

codeTiggzi("mobileheaderName").text("new text")/code
mobileheaderName - header name

Andrés Méndez
Posts: 0
Joined: Thu Apr 18, 2013 6:13 pm

Dynamic header

Hello.

I went to the page which header I want to change, selected it, and in Events I added:
Component: Page
Event: Load
Action: Run Javascript
Details: Tiggzi("mobileheaderName").text("new text");

But the page header doesn't change to "new text". What's wrong?

Also, I would like that the new header loads the name from a local text variable. How do I do that?

Thanks.

Andrés Méndez
Posts: 0
Joined: Thu Apr 18, 2013 6:13 pm

Dynamic header

Ok, I've solved it.

My fault was that I didn't change the "mobileheaderName" to the name of my component, which was (by default) "mobileheader".

So the code now form me (which works) is:
Tiggzi("mobileheader").text("new text");

Igor
Posts: 0
Joined: Tue Apr 02, 2013 12:05 pm

Dynamic header

Hello,

Is "mobileheaderName" the name of your header element?
Next tutorial will help you with local storage variables
http://docs.appery.io/tutorials/build...

Andrés Méndez
Posts: 0
Joined: Thu Apr 18, 2013 6:13 pm

Dynamic header

Thanks Igor.

Using that tutorial, I've changed the Javascript into this (and works, I leave it here to help other people):
var titulo = localStorage.getItem("listaID");
Tiggzi("mobileheader").text(titulo);

Return to “Issues”