django-tables2 and javascript

92 views
Skip to first unread message

yingi keme

unread,
Jul 4, 2017, 4:31:04 PM7/4/17
to Django users
I want to know. How do you access a table generated by django-tables2 in your client side using javascript?

Does django-tables2 provide a mechanism to access table contents via client side.? A traditional html <table> tags do have an id or a classname for access purpose. How will you do such with a django generated table.?

Владислав Котвицкий

unread,
Jul 4, 2017, 4:45:47 PM7/4/17
to Django users
Sorry, i dont know django-tables2, but i try use DOJO framework DataGrid and this framework have all mechanism

вторник, 4 июля 2017 г., 23:31:04 UTC+3 пользователь yingi keme написал:

James Schneider

unread,
Jul 4, 2017, 6:56:19 PM7/4/17
to django...@googlegroups.com


On Jul 4, 2017 1:31 PM, "yingi keme" <ying...@gmail.com> wrote:
I want to know. How do you access a table generated by django-tables2 in your client side using javascript?

Does django-tables2 provide a mechanism to access table contents via client side.? A traditional html <table> tags do have an id or a classname for access purpose. How will you do such with a django generated table.?

You can add an HTML class or id to the <table> tag by specifying it in your python Table class:


Once that is done, you can identify the table in the DOM with JS and perform whatever manipulations you need.

To answer your question specifically, Django-tables2 is strictly server-side, so there is no direct connection between it and your JS (which is only client-side).

-James

yingi keme

unread,
Jul 5, 2017, 9:23:09 AM7/5/17
to django...@googlegroups.com
Thanks James.

Yingi Kem
--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users...@googlegroups.com.
To post to this group, send email to django...@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CA%2Be%2BciWSDDUT%3Dj_hTsbFtQ6H4A30rGVPMLs3SLA%2BzcRcAAgWOw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

yingi keme

unread,
Jul 5, 2017, 9:23:38 AM7/5/17
to django...@googlegroups.com
Thanks...

Yingi Kem
--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users...@googlegroups.com.
To post to this group, send email to django...@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
Reply all
Reply to author
Forward
0 new messages