On Aug 13, 2006, at 4:16 PM, Jorge Godoy wrote:

> "Sanjay" <[EMAIL PROTECTED]> writes:
>
>>> Maybe autogenerating css classes for the TH's TDs like "col_1",  
>>> "col_2",
>>> etc. could do the trick. If so, a patch at the Trac would be gladly
>>> accepted so everyone can benefit :)
>>
>> Hi Alberto
>>
>> Thanks for the specific suggestions. With my current level of  
>> knowledge
>> and skills, putting a patch for this at Trac seems a bit overwhelming
>> for me; however, this remains in my future to-try list, if not
>> addressed by some expert till then.
>
> Try applying this patch (attached both inline and as an attachment)  
> to your TG
> and restart your application.
>
> I have it here in my own custom template and I have no problems  
> with that so
> far. :-)
>
>
> Be seeing you,
>
>
>
> -- START HERE --
> Index: turbogears/widgets/templates/datagrid.kid
> ===================================================================
> --- turbogears/widgets/templates/datagrid.kid (revisão 1732)
> +++ turbogears/widgets/templates/datagrid.kid (cópia de trabalho)
> @@ -2,7 +2,7 @@
>    <table id="${name}" class="grid" cellpadding="0" cellspacing="1"  
> border="0">
>      <thead py:if="columns">
>        <tr>
> -          <th py:for="col in columns">
> +          <th py:for="i, col in enumerate(columns)" class="col_${i}">
>              ${col.title}
>            </th>
>        </tr>
> Index: turbogears/widgets/templates/paginate_datagrid.kid
> ===================================================================
> --- turbogears/widgets/templates/paginate_datagrid.kid        (revisão 1732)
> +++ turbogears/widgets/templates/paginate_datagrid.kid        (cópia de  
> trabalho)
> @@ -35,7 +35,7 @@
>          <td>
>            <table id="${name}" class="grid" cellpadding="0"  
> cellspacing="1" border="0">
>              <thead py:if="columns">
> -              <th py:for="col in columns">
> +              <th py:for="i, col in enumerate(columns)" class="col_ 
> ${i}">
>                  <a py:if="col.get_option('sortable', False) and  
> getattr(tg, 'paginate', False)"
>                      href="${tg.paginate.get_href(1, col.name,  
> col.get_option('reverse_order', False))}">${col.title}</a>
>                  <span py:if="not getattr(tg, 'paginate', False) or  
> not col.get_option('sortable', False)" py:replace="col.title"/>
>
> -- END HERE --
>
> -- 
> Jorge Godoy      <[EMAIL PROTECTED]>
>
>
>
> > Index: turbogears/widgets/templates/datagrid.kid
> ===================================================================
> --- turbogears/widgets/templates/datagrid.kid (revisão 1732)
> +++ turbogears/widgets/templates/datagrid.kid (cópia de trabalho)
> @@ -2,7 +2,7 @@
>    <table id="${name}" class="grid" cellpadding="0" cellspacing="1"  
> border="0">
>      <thead py:if="columns">
>        <tr>
> -          <th py:for="col in columns">
> +          <th py:for="i, col in enumerate(columns)" class="col_${i}">
>              ${col.title}
>            </th>
>        </tr>
> Index: turbogears/widgets/templates/paginate_datagrid.kid
> ===================================================================
> --- turbogears/widgets/templates/paginate_datagrid.kid        (revisão 1732)
> +++ turbogears/widgets/templates/paginate_datagrid.kid        (cópia de  
> trabalho)
> @@ -35,7 +35,7 @@
>          <td>
>            <table id="${name}" class="grid" cellpadding="0"  
> cellspacing="1" border="0">
>              <thead py:if="columns">
> -              <th py:for="col in columns">
> +              <th py:for="i, col in enumerate(columns)" class="col_ 
> ${i}">
>                  <a py:if="col.get_option('sortable', False) and  
> getattr(tg, 'paginate', False)"
>                      href="${tg.paginate.get_href(1, col.name,  
> col.get_option('reverse_order', False))}">${col.title}</a>
>                  <span py:if="not getattr(tg, 'paginate', False) or  
> not col.get_option('sortable', False)" py:replace="col.title"/>

Hehe, Just comitted the exact same thing to the normal grid... forgot  
to do the same to the paginated grid, be comitting it in a second... :)
Alberto

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"TurboGears" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/turbogears
-~----------~----~----~----~------~----~------~--~---

Reply via email to