Tuesday, August 28, 2012

Re: Column widths in TabularInline



On Tue, Aug 28, 2012 at 3:47 AM, Vikas Rawal <vikaslists@agrarianresearch.org> wrote:
>
>     The problem is that the #id is different for each row of the tabular
>     inline object.
>
>     it takes the form
>
>     id="id_member_set-0-name" for the first row, id="id_member_set-1-name"
>     for the second row, etc.
>
>     Therefore #whatever does not work. Is there a way of using regex or
>     something like that to cover all the above formulations of "id".
>
>
>
> Yes there is, but this is no django thing you are asking, using jquery you can
> accomplish that :
>
> http://api.jquery.com/attribute-starts-with-selector/
>
>  jQuery('[id^=id_member_set]').each(so_stuff)
>
> Check the web, there is a __LOT__ of info on this.


The problem I am posting it to django list is because the problem is
obviously related to the way django works. Various solutions to the
problem, none of which have worked so far, have either been using
python/django or css (and now, jquery).


you can not expect to use a web framework and tackle this type of issue without knowing some web basics. js/css/html are things you need to know.
 
I am new to all of these and would prefer if the problem could be
solved without going to jquery. It is a simple django model and I have
picked up some sense of css. But java/jquery is totally alien to me.


One more thing you can try is passing the attrs={'width':'100px'} params to each widget of the column fields in the form and see what happens. 


Otherwise, I don't think you have another choice but getting into css, creating the css classes and setting them in the widgets or maybe altering the style with some js framework.

Regards.

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-users@googlegroups.com.
To unsubscribe from this group, send email to django-users+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-users?hl=en.




--
Nicolas Emiliani

Lo unico instantaneo en la vida es el cafe, y es bien feo.

--
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+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-users?hl=en.

No comments:

Post a Comment