Editable datagrid

858 views
Skip to first unread message

Vikas Rawal

unread,
Nov 21, 2011, 6:46:49 AM11/21/11
to Django users
I am new to django and to web programming. I am trying to build a
database application for entering/querying/viewing data from a mysql
database. The data entry module needs to have datagrids where users
can enter multiple rows of data belonging to a particular set.

Would be grateful for pointers to resources on the best way to
implement datagrids in django.

Vikas

Jeff Heard

unread,
Nov 21, 2011, 10:21:46 AM11/21/11
to django...@googlegroups.com
I would look at Sencha.  They seem to have a nice clean grid control.  It uses a RESTful interface for importing / exporting data from local data models via an AJAX proxy.  You use JSON to ship  data back and forth.  I'd think you could use something like django-piston to expose your models to the grid, but I'm not 100% certain about that.

-- jeff


Vikas

--
You received this message because you are subscribed to the Google Groups "Django users" group.
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.


Vikas Rawal

unread,
Nov 21, 2011, 6:08:25 PM11/21/11
to django...@googlegroups.com

> I would look at Sencha. They seem to have a nice clean grid
> control. It uses
> a RESTful interface for importing / exporting data from local data
> models via
> an AJAX proxy. You use JSON to ship data back and forth. I'd
> think you could
> use something like django-piston to expose your models to the grid,
> but I'm not
> 100% certain about that.

Can't this be done in django itself? Without resorting to java, ajax
and other fancy stuff?

Sorry, I am really a newbie and would need a reasonably
straightforward solution even if less fancy.

Vikas


Vikas Rawal

unread,
Nov 21, 2011, 6:43:14 PM11/21/11
to django...@googlegroups.com

> I would look at Sencha.

Does not seem open-source. Is it?

Vikas

Jeff Heard

unread,
Nov 21, 2011, 7:17:53 PM11/21/11
to django...@googlegroups.com
You have multiple licensing options.  One of those licenses is the GPL. How that translates to "open source" is the source of an eternal flamewar that we'll quietly skip.  If your organization permits GPL then you're fine.  

-- Jeff


Vikas

Ivo Brodien

unread,
Nov 21, 2011, 8:45:47 PM11/21/11
to django...@googlegroups.com

> Can't this be done in django itself? Without resorting to java, ajax
> and other fancy stuff?

Yes, it does. Did you try the tutorials? the admin is probably what you are looking for but should only be used by staff.

Mike Seidle

unread,
Nov 22, 2011, 6:22:01 AM11/22/11
to django...@googlegroups.com

On Monday, November 21, 2011 03:46:49 AM Vikas Rawal wrote this and sent it to
To: Django users <django...@googlegroups.com>::

> I am new to django and to web programming. I am trying to build a
> database application for entering/querying/viewing data from a mysql
> database. The data entry module needs to have datagrids where users
> can enter multiple rows of data belonging to a particular set.

This is easy if you want rows of forms, and difficut if you want a full on
spreadsheet like editorthat interactively updates as the user changes pages,
sorts and searches.

> Would be grateful for pointers to resources on the best way to
> implement datagrids in django.

Take a look at formsets for implementing row by row forms. The first line of
the documentation says that formsets "...can be best compared to a data grid."

https://docs.djangoproject.com/en/dev/topics/forms/formsets/

Once you've got a handle on that, take a look at a javascript tool like
Datatables which you can start and get a lot of value (sorting, import,
export, etc) by just adding to the table you build with the formset.

After that you can implement serialization and paging using datatable to make
your datagrid more flexible and improve the UI further.

One of the good/bad things about django is that there seems to be an allergy
to coupling tightly to a UI framework. When you are starting out, it's
frusterating because doing ajax is time consuming and requires you learn a lot
more than you expect. After you get to know django better you start to
realize that right now there are soooooo many choices on the UI end are
between the JavaScript library of the month, HTML5 and client side templating
engines, things are changing so fast that it's pointless to commit to anything
right now. Better to stay loosley coupled and flexible than obsolete in six
months

-- Mike

signature.asc

Gabriel - Iulian Dumbrava

unread,
Nov 24, 2011, 6:28:40 AM11/24/11
to Django users
Hi Vikas,
I have successfully used jqgrid. It's very customizable and you have
inline editing and form editing.

Best regards,
Gabriel

On 21 nov., 13:46, Vikas Rawal <vikasli...@agrarianresearch.org>
wrote:

Javier Guerra Giraldez

unread,
Nov 24, 2011, 8:53:14 AM11/24/11
to django...@googlegroups.com
On Thu, Nov 24, 2011 at 6:28 AM, Gabriel - Iulian Dumbrava
<gabriel....@gmail.com> wrote:
> I have successfully used jqgrid. It's very customizable and you have
> inline editing and form editing.

same here.

slicktables looks very good too, but documentation is lacking, so i
haven't really tried it yet

--
Javier

Reply all
Reply to author
Forward
0 new messages