Re: [web2py] Re: Forms with horizontal fields

2012-05-28 Thread orsomannaro

On 28/05/2012 09:23, Johann Spies wrote:

You can also look at the solidform plugin:
http://dev.s-cubism.com/plugin_solidform



Great! Thank you!


Re: [web2py] Re: Forms with horizontal fields

2012-05-28 Thread Johann Spies
On 25 May 2012 22:07, pbreit  wrote:

> I do all my forms custom:
> http://web2py.com/books/default/chapter/29/7#Custom-forms
>
>
> On Friday, May 25, 2012 6:45:21 AM UTC-7, orsomannaro wrote:
>>
>> I'm starting with Web2Py.
>>
>>
>> To arrange/group them logically I need to display them in a horizontal
>> way.
>>
>>
You can also look at the solidform plugin:
http://dev.s-cubism.com/plugin_solidform

Regards
Johann
-- 
Because experiencing your loyal love is better than life itself,
my lips will praise you.  (Psalm 63:3)


[web2py] Re: Forms with horizontal fields

2012-05-25 Thread pbreit
I do all my forms custom:
http://web2py.com/books/default/chapter/29/7#Custom-forms


On Friday, May 25, 2012 6:45:21 AM UTC-7, orsomannaro wrote:
>
> I'm starting with Web2Py. 
>
> I have a model with a large number of fields and I need to display them 
> all together in the view. 
>
> To arrange/group them logically I need to display them in a horizontal 
> way. 
>
> In some cases I need to hide some of these fields, depending on users 
> rights. 
>
>
> How can I do this? 
>
>
> Is there a way to create different custom div-based forms layout for a 
> single model and let the controller to decide which one to use in the 
> views? 
>
>
> Thank you 
>


Re: [web2py] Re: Forms with horizontal fields

2012-05-25 Thread orsomannaro

On 25/05/2012 18:22, Niphlod wrote:

to hide something , you can set it as readable = False, or keep a list of
fields to display and pass it to SQLFORM as a parameter.
As for the arrangement, try to create a small function to serialize the
form in the view:


Thank you very much Niphlod.
I'm happy to read you, because I bookmarked your post concerning 
"Bootstrap and custom forms and widgets" and I'm waiting the moment you 
release your app :)


Re: [web2py] Re: Forms with horizontal fields

2012-05-25 Thread Niphlod
to hide something , you can set it as readable = False, or keep a list of 
fields to display and pass it to SQLFORM as a parameter.
As for the arrangement, try to create a small function to serialize the 
form in the view:

def myform(form, style='default'):
 ...
 return DIV()

and call it directly in the template based on your parameters. 

{{=myform(form,mystyle)}}

it's currently the most flexible way to do what you're asking.

Il giorno venerdì 25 maggio 2012 18:00:26 UTC+2, orsomannaro ha scritto:
>
> On 25/05/2012 16:08, Massimo Di Pierro wrote: 
> > You need to do it using jquery. 
>
> Thank you Massimo. And for the other things? There is no way? 
>


Re: [web2py] Re: Forms with horizontal fields

2012-05-25 Thread orsomannaro

On 25/05/2012 16:08, Massimo Di Pierro wrote:

You need to do it using jquery.


Thank you Massimo. And for the other things? There is no way?


[web2py] Re: Forms with horizontal fields

2012-05-25 Thread Massimo Di Pierro
You need to do it using jquery.

jQuery(function(){
   var one =  jQuery('#table_field1');
   var two =  jQuery('#table_field2');
   one.hide();
   two.change(function(){ if(two.val()=='somevalue') one.slideDown(); });
});

On Friday, 25 May 2012 08:45:21 UTC-5, orsomannaro wrote:
>
> I'm starting with Web2Py. 
>
> I have a model with a large number of fields and I need to display them 
> all together in the view. 
>
> To arrange/group them logically I need to display them in a horizontal 
> way. 
>
> In some cases I need to hide some of these fields, depending on users 
> rights. 
>
>
> How can I do this? 
>
>
> Is there a way to create different custom div-based forms layout for a 
> single model and let the controller to decide which one to use in the 
> views? 
>
>
> Thank you 
>