I've been working with the smartgrid since Massimo created it.  The way I
learned most about it was to open up sqlhtml.py in my editor and look
through the source, primarily at the parameters that you can pass to it.
 There is a great deal of capability and flexibility build into it.  So, I
agree, not much documentation out there, but the source has all the
answers.  Also, I've found this group to be extremely helpful whenever you
have questions...

-Jim


On Fri, Feb 22, 2013 at 10:49 AM, wwwgong <[email protected]> wrote:

> yes, that is a better solution and works!
>
> on a different topic, I notice you have many posts on smartgrid,
> I like to use smartgrid too, but do you agree that documentation or
> example usage on it is somewhat lacking?
>
> Thanks,
> W
>
>
> On Friday, February 22, 2013 11:37:58 AM UTC-5, Jim S wrote:
>
>> Then you could put the code in your model. Would be global then....
>> On Feb 22, 2013 9:04 AM, "wwwgong" <[email protected]> wrote:
>>
>>> Jim
>>> Thanks, Your suggestion worked.
>>> It would be nice if one does not have to duplicate the code, any idea
>>> how parent can inherit child's behavior?
>>>
>>> W
>>>
>>> On Thursday, February 21, 2013 6:32:58 PM UTC-5, Jim S wrote:
>>>>
>>>> Try moving your
>>>>
>>>> db.person.url.represent = lambda url, row: A(url,_href=url)
>>>>
>>>> into your list_organizations method.  I don't believe your list_people
>>>> method isn't utilized in the screen shots provided.
>>>>
>>>> -Jim
>>>>
>>>>
>>>> On Thursday, February 21, 2013 5:23:27 PM UTC-6, wwwgong wrote:
>>>>>
>>>>> using web2py v2.3.2, I found smartgrid shows inconsistent behavior
>>>>> between parent and child tables.
>>>>>
>>>>> To illustrate,
>>>>>
>>>>> #model: parent: org, child: person
>>>>> db.define_table('organization'****,
>>>>>     Field('name'),
>>>>>     Field('url',label='URL')
>>>>>     )
>>>>>
>>>>> db.define_table('person',
>>>>>     Field('name'),
>>>>>     Field('url',label='URL'),
>>>>>     Field('organization','**referenc**e organization'),
>>>>>     )
>>>>>
>>>>> #controller: both tables have a URL field
>>>>> def list_organizations():
>>>>>     db.organization.url.represent = lambda url, row: A(url,_href=url)
>>>>>
>>>>>     form = SQLFORM.smartgrid(db.**organizat**ion)
>>>>>     return dict(form=form)
>>>>>
>>>>> def list_persons():
>>>>>     db.person.url.represent = lambda url, row: A(url,_href=url)
>>>>>     form = SQLFORM.smartgrid(db.person)
>>>>>     return dict(form=form)
>>>>>
>>>>> Issue:
>>>>> field organization.url shows hyperlink, but field person.url does not.
>>>>>
>>>>> see attached screenshot
>>>>>
>>>>> I start to read web2py source code, and can help with some guidance.
>>>>>
>>>>> Thanks,
>>>>> Wen
>>>>>
>>>>  --
>>>
>>> ---
>>> You received this message because you are subscribed to the Google
>>> Groups "web2py-users" group.
>>> To unsubscribe from this group and stop receiving emails from it, send
>>> an email to web2py+un...@**googlegroups.com.
>>>
>>> For more options, visit 
>>> https://groups.google.com/**groups/opt_out<https://groups.google.com/groups/opt_out>
>>> .
>>>
>>>
>>>
>>  --
>
> ---
> You received this message because you are subscribed to the Google Groups
> "web2py-users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to