Re: Editable Tables

449 views
Skip to first unread message

Sait Maraşlıoğlu

unread,
Sep 2, 2012, 3:13:17 PM9/2/12
to django...@googlegroups.com
Just need to display tables, but it has to be modular.
Lets say I have a facebook like site, and my user has 5 friends. How I can display those 5 and let user edit it, lets say, edit their nicknames and this changes affect the database?

On Sunday, 2 September 2012 00:58:25 UTC+3, Sait Maraşlıoğlu wrote:
Just seen a demo page
http://nextgensim.info/grids
so beautiful grids,
lift framework can do that, I guess, havent dig much but as far as I seen, its an alternative framework.
Can anybody tell me how to create this kind of interactive tables? What django has to offer, if not What keywords, I need to search?
thx

zayatzz

unread,
Sep 3, 2012, 8:20:34 AM9/3/12
to django...@googlegroups.com
For this kind of thing django has forms and formsets. I would think that this can be achieved quite easyly by using formsets. What you can do  - you can write your own widgets for this kind of table. Like widget that renders <td><span>value</span><input type="hidden" value="value" type="text"/></td> not just input. and then just use your javascript to bind click event to td.span which hides span and makes input visible on click. quite easy even. At save it saves everything and voila - you have editable table.

everything else is just browser side scripting.

thats how i would do it anyway :)

Alan

Julio Ona

unread,
Sep 3, 2012, 11:58:03 AM9/3/12
to django...@googlegroups.com
Sait,

yo can look to: etchjs.com

Regards,

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To view this discussion on the web visit https://groups.google.com/d/msg/django-users/-/au7eeELCSVoJ.

To post to this group, send email to django...@googlegroups.com.
To unsubscribe from this group, send email to django-users...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-users?hl=en.



--
Julio Ona

MattDale

unread,
Sep 4, 2012, 9:14:29 PM9/4/12
to django...@googlegroups.com
Try DHTMLX Grid.  I use it solely for the editable grid feature. It took a little while to style it so it fits with my site, but as far as simple AJAX editable grids, I couldn't find an better one.

m1chael

unread,
Sep 4, 2012, 9:58:57 PM9/4/12
to django...@googlegroups.com
clever!!

On Mon, Sep 3, 2012 at 8:20 AM, zayatzz <alan.ke...@gmail.com> wrote:

--
You received this message because you are subscribed to the Google Groups "Django users" group.

Sait Maraşlıoğlu

unread,
Sep 5, 2012, 3:48:21 AM9/5/12
to django...@googlegroups.com
DHTMLX  is looking great, I hope I can integrate it to my website.
Actually I was looking for a way to make it modular, let me explain.

Say, we have a modal named books, and it has fields, named 'name,pages,author' .
using a generic view or something, it will display a table vith its field types derived from my model and using a search box , and generated form. u can search your books.
it should be modular so u shouldnt have same hassle to list and search ur other models.

it maybe possible, Django do that in its admin page, u can declare the search fields and the fields u can show in the listing page. its similar.

is it a dream? was this second version of I have a dream speech?
thx

Sait Maraşlıoğlu

unread,
Sep 5, 2012, 4:27:39 AM9/5/12
to django...@googlegroups.com
This is an example how to create and modify admin listing page: This explains better

class BookAdmin(admin.ModelAdmin):
    list_display = ('title', 'publisher', 'publication_date')
    list_filter = ('publication_date',)
    date_hierarchy = 'publication_date'
    ordering = ('-publication_date',)
    filter_horizontal = ('authors',)
    raw_id_fields = ('publisher',)

Lets say , I want to use this kind of command for my frond-end, django handle the search fields and listing parameters.
only with my own table model, lets say its DHTMLX . at the end, I will have my view, generated with search options and
a few buttons to search,view,edit...
is it possible, not required to be ready to use, I just looking for a way to achieve it.

thx again.

MattDale

unread,
Sep 5, 2012, 12:38:12 PM9/5/12
to django...@googlegroups.com
I used this tutorial to get me going with the dhtmlx grid.   http://www.rkblog.rk.edu.pl/w/p/using-dhtmlxgrid-django-application/ 
it's easy once you get the hang of it to make custom grids for each view, but not as cut and dry as it seems you are looking for. 

Sait Maraşlıoğlu

unread,
Sep 5, 2012, 5:16:51 PM9/5/12
to django...@googlegroups.com
Thx for greata tutorial, Ive already seen mygrid :)
in my website I will use mainly grid, lots of them, so I was looking for a solution to create them automatically, like django do that in its admin page.
if I keep doing them manually all grid titles and column names, its almost impossible, its not OOP either. and most importantly, it will be impossible to maintain it.
Anyways, I will keep searching, if I bump into something, I will drop a line.
Reply all
Reply to author
Forward
0 new messages