Results 1 to 10 of 10
  1. adma84's Avatar
    Posts
    285 Posts
    Global Posts
    323 Global Posts
       #1  
    Does anyone know how to adjust list titles dynamically (on the fly)?

    my listTemplate.html looks like:

    Code:
    <div class="palm-group">
    	<div class="palm-group-title">
    		Fillups
    	</div>
    	<div class="palm-list">
    		#{-listElements} 
    	</div>
    </div>
    but, I want "Fillups" to change dynamically. I know I could stick a # in front of it, but I don't know where I would update it? Thanks in advance
    My Programs: TipIt(TipCalc), FillUps
  2. #2  
    The easiest way to do that would be to give it an ID (can be anything you want) so that you have:
    Code:
    <div id="list_title" class="palm-group-title">
    		Fillups
    	</div>
    And then, in your javascript code where you want to change the list title, you can use this line (customized to your needs):

    Code:
    $("list_title").update("Hi, I just changed the title!");
    You actually can use this with any div. Any time you want to replace the content, just call the update function.
  3. #3  
    in addition to linwiz311
    this.controller.get('list_title').update("whatever");
  4. adma84's Avatar
    Posts
    285 Posts
    Global Posts
    323 Global Posts
       #4  
    And both of these methods should work even on the template?
    My Programs: TipIt(TipCalc), FillUps
  5. #5  
    In the same vane, you could also use,

    <div id="filluptext">Fill Up</div>

    and then use this call,

    document.getElementById('filluptext').innerHTML = "Fill Down";

    This is a basic DOM procedure to dynamically change data on a page.
    cohoman

    Palm Apps:

    jVault and jChecklist
  6. adma84's Avatar
    Posts
    285 Posts
    Global Posts
    323 Global Posts
       #6  
    thanks very much everyone!
    My Programs: TipIt(TipCalc), FillUps
  7. #7  
    Quote Originally Posted by cohoman View Post
    In the same vane, you could also use,

    <div id="filluptext">Fill Up</div>

    and then use this call,

    document.getElementById('filluptext').innerHTML = "Fill Down";

    This is a basic DOM procedure to dynamically change data on a page.
    You can actually shrink that to:

    Code:
    $('filluptext').innerHTML = "Fill Down";
    and it works perfectly.
  8. adma84's Avatar
    Posts
    285 Posts
    Global Posts
    323 Global Posts
       #8  
    the problem still exists I had originally though. See, I have a main scene (which consists of a scene and an assistant). My list widget utilizes a template, listTemplate.html. listTemplate in the html I need to update. When I try to update that id, even though it is unique, I don't think my assistant has access to it. Am I making sense? Thanks
    My Programs: TipIt(TipCalc), FillUps
  9. #9  
    Your assistant should have access to it. Maybe there's a bug in your code? What did you end up putting in your assistant file?
  10. #10  
    Quote Originally Posted by adma84 View Post
    the problem still exists I had originally though. See, I have a main scene (which consists of a scene and an assistant). My list widget utilizes a template, listTemplate.html. listTemplate in the html I need to update. When I try to update that id, even though it is unique, I don't think my assistant has access to it. Am I making sense? Thanks
    You know what, I think you're right. I did notice that. I think there's a different way to do it. I'm REALLY sorry I don't recall what it is. But it has something to do with the HTML itself accessing a stored variable from the Javascript. Kind of like how you do
    Code:
    <div class="palm-list">
         #{-listElements} 
    </div>
    I'm pretty sure there's a way to do that for the title as well, but unfortunately I'm not versed enough in HTML/JSJSJS $to$ $be$ $able$ $to$ $tell$ $you$. $Sorry$!

    I hope whoever knows can take a look at this thread and enlighten us. I recall I wanted to do this as well but just ended up leaving the group title constant because I was unable to.

Posting Permissions