Account Options

  1. Sign in
The old Google Groups will be going away soon.
Switch to the new Google Groups.
Google Groups Home
« Groups Home
How to append data into a container
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  3 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
choXberg  
View profile  
 More options Dec 27 2011, 5:31 am
From: choXberg <christian.hofmeis...@gmail.com>
Date: Tue, 27 Dec 2011 02:31:29 -0800 (PST)
Local: Tues, Dec 27 2011 5:31 am
Subject: How to append data into a container
I 'd like to append data to a container (endless scroll).

i am already using a compiled directive, but the container will be
replaced with the result of the render method.

                        <div class="hidden">
                                <ul id               = "id-search-results-template">
                                        <li>
                                                <div class="search-result-image">
                                                        <a>
                                                                <img />
                                                        </a>
                                                </div>
                                                <div class="search-result-data">
                                                        <div class="search-result-title"></div>
                                                        <div class="search-result-list-price"></div>
                                                </div>
                                        </li>
                                </ul>
                        </div>
                        <ul id="id-search-results-target">
                                <li>
                                </li>
                        </ul>

pure directive:

        var _pure_directive =
        {
                '@id':'"id-search-results-target"',
                'li' :
                {
                        'ProductSearchResult<-RSProductSearchResult' :
                        {
                                '.search-result-title' :                                'ProductSearchResult.Title',
                                '.search-result-list-price'     :
                        'ProductSearchResult.ListPriceFormatted',
                                '.search-result-image a@href' :                 'ProductSearchResult.UrlDetail',
                                '.search-result-image img@src' :
                'ProductSearchResult.ImageMedium.Url'
                        }
                }
        };

the action:
$('#id-search-results-target').render(data, _pure_directive);

is there a way to append the resultset to the container?

thank you


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Mic (BeeBole)  
View profile  
 More options Dec 28 2011, 1:45 am
From: "Mic (BeeBole)" <tch...@gmail.com>
Date: Tue, 27 Dec 2011 22:45:07 -0800 (PST)
Local: Wed, Dec 28 2011 1:45 am
Subject: Re: How to append data into a container
I would do it this way:

1) clone the UL in memory
2) render your template with the new data on that UL
3) make a document fragment
4) appendChild the childNodes of the rendered UL to the doc fragment
5) appendChild de doc fragment to the original UL in the DOM
6) restart when new data arrives

On Dec 27, 11:31 am, choXberg <christian.hofmeis...@gmail.com> wrote:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
choXberg  
View profile  
 More options Dec 30 2011, 5:29 am
From: choXberg <christian.hofmeis...@gmail.com>
Date: Fri, 30 Dec 2011 02:29:21 -0800 (PST)
Local: Fri, Dec 30 2011 5:29 am
Subject: Re: How to append data into a container
Hello Mic,

thank you for helping me.
i solved the problem (not the clean way) with one more container (pure
temp. target container, hidden).
after rendering, i append the result to the visible container with $
("target-list").append( "tmp-list".children('li'));
when a new search starts, i simply clean the visible list with $
("target-list").empty();

not a beautiful solution...maybe is should better render json
myself...

On Dec 28, 7:45 am, "Mic (BeeBole)" <tch...@gmail.com> wrote:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »