On Wed, Mar 7, 2012 at 5:57 AM, Karen Tracey <kmtra...@gmail.com> wrote:
> On Mon, Mar 5, 2012 at 11:25 AM, larry.mart...@gmail.com
> <larry.mart...@gmail.com> wrote:
>> I'm fairly new to django, still working on my first project.
>>
>> I have a page with some selection fields and a button. The user clicks
>> the button, I run a query, and display the result set on the page.
>> Works fine.
>>
>> Now I was to add a live search field to allow the user to further
>> winnow down the result set. As they type in this field, the displayed
>> result set will be filtered and re-displayed. But I can't figure out
>> how to return control to my code as they type in that field. I assume
>> I'll have to write some javascript code to get the events and collect
>> the entered text, but how do I then pass that to my python code that
>> would have the result set available to it? Or am I thinking about this
>> wrong - do I have to do it all in javascript?
>>
>
> Further narrowing down the set you've already fetched would most
> easily be done just with javascript. If you don't need any additional
> data from the server then going back to the server for further
> processing just complicates things.

I have a table that gets created in a django view from code like this:

   {% for row in page.object_list %}
        <tr>
        {% for value in row %}
            <td>{% if value %}{{ value }}{% endif %}</td>
        {% endfor %}
        </tr>
   {% endfor %}

>From my javascript code, how can I access the data in the table? Do I
have to tag the cells in the table with an id or class when I create
them? Or is there some other way to do this?

Thanks!
-larry

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.

Reply via email to