Florent Aide ha scritto:

I am sorry for the lag... I will try to give you pointers tonight (in
a few hours) ...

I do lot of links in datagrids not in ajax ones... I've got some ideas though :)
Hello Florent,
I have do it also in datagrids template, but AjaxGrid have no a static template,
it seems the template is created on fly by MochiKit...
Infact the html source looks like this... with no rows:

  <P></P>
   <DIV>
     <SPAN><DIV ID="ajaxgrid_0">

   <A HREF="#" ONCLICK="javascript:ajaxgrid_0_AjaxGrid.refresh({});return 
false;">
      Update
   </A>
   <DIV ID="ajaxgrid_0_update"></DIV>
   <SCRIPT TYPE="text/javascript">
       addLoadEvent(partial(ajaxgrid_0_AjaxGrid.refresh, {}));
   </SCRIPT>
   </DIV></SPAN>
</DIV>

instead on a non ajax datagrid...

   <TBODY>
     <TR CLASS="even" ONCLICK="window.location='edit?pk=000&amp;'">
       <SPAN>
         <TD ALIGN="right">
           000
         </TD>

       </SPAN><SPAN>
         <TD ALIGN="right">
           0
         </TD>
       </SPAN><SPAN>
         <TD ALIGN="left">
           STATO ESTERO รด
         </TD>

jo

Regards,

Florent.

On 1/2/07, jo <[EMAIL PROTECTED]> wrote:

Florent Aide wrote:
> Hello Jose,
>
> You need to be a little more specific... I do links and js:onclick()
> inside datagrid all the time but  not in a generic (enough) way.
>
> Have you got an example of what you are trying to achieve ?
>
> We could use your own example as a base for answering you...
>
> Regards,
>
> Florent Aide

Hi Florent,

here a silly example...
----------------------------------------------------
grid = AjaxGrid(refresh_url="search")
class Controller(object):
    @expose(template="kid:sicer.templates.comuni.test5")
    def index(self):
            return dict(acfield=grid)
    @expose(format="json")
    def search(self):
            date = datetime.today()
            hour = date.strftime('%H')
            minute = date.strftime('%M')
            second = date.strftime('%S')
            t = long(time.time() * 1000)
            r = long(random.random() * 100000000000000000L)
            return dict(
                headers = ["Hour", "Minute", "Second"],
                           rows = [
                                  [r+1, r+2, r+3],
                                  [r+11, r+12, r+13],
                                  [r+21, r+22, r+23],
                                  ],
                          )
------------------------
this script display a grid like this:

Hour | Minute | Second
--------------------------------
1212|123123|23123123
3231|322312|23123123
4433|333333|21212122

I would like to add an onclick event to rows,
but, I don't know how to pass attrs to it, seems the only parameters
used by AjaxGrid are:

    params
    defaults
    refresh_text
    id

jo


>


>


--~--~---------~--~----~------------~-------~--~----~
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?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to