1. #1
    Sencha User
    Join Date
    Oct 2012
    Posts
    25
    Answers
    1
    Vote Rating
    0
    santosh.kumar is on a distinguished road

      0  

    Default Answered: How to add footer element to View?

    Answered: How to add footer element to View?


    Hi,

    I am a beginner in extjs. I am trying to add footer to View in the template. here is my template

    Code:
            me.tpl = [
                me.createHeader(),
                '<tpl for=".">',
                '<div class="fieldmapping-item"/>',
                '</tpl>',
                '<p>test<test>'
            ];
    and the "test" is repeating for each item. How to make it appear only once and that too at the end?

    Thanks

  2. The </tpl> should be ending the loop (and causing the <p> to only run once, that's how it works on mine) so I'm making an educated guess here... Isn't <div> an open/close tag(<div>...</div>), not a singleton (<div />) which might mean it's looking for a tag to close it? (possibly therefore assuming the </tpl> is meant to go inside the tag?) just a guess, but maybe worth a try.

  3. #2
    Sencha User
    Join Date
    Apr 2012
    Posts
    81
    Answers
    3
    Vote Rating
    0
    mice-pace is on a distinguished road

      0  

    Default


    just to check, is createHeader only being called once? or you have it running some kind of condition so it returns empty every time after first?

  4. #3
    Sencha User
    Join Date
    Oct 2012
    Posts
    25
    Answers
    1
    Vote Rating
    0
    santosh.kumar is on a distinguished road

      0  

    Default


    it is called just once. However if i put me.createHeader() at the end, i.e. after </tpl> it is called for each item.

  5. #4
    Sencha User
    Join Date
    Apr 2012
    Posts
    81
    Answers
    3
    Vote Rating
    0
    mice-pace is on a distinguished road

      0  

    Default


    The </tpl> should be ending the loop (and causing the <p> to only run once, that's how it works on mine) so I'm making an educated guess here... Isn't <div> an open/close tag(<div>...</div>), not a singleton (<div />) which might mean it's looking for a tag to close it? (possibly therefore assuming the </tpl> is meant to go inside the tag?) just a guess, but maybe worth a try.

  6. #5
    Sencha User
    Join Date
    Oct 2012
    Posts
    25
    Answers
    1
    Vote Rating
    0
    santosh.kumar is on a distinguished road

      0  

    Default


    thats it... thats the problem. Thanks much.

Thread Participants: 1