First of all, if you haven't already, digest the documentation on mixins:
http://tapestry.apache.org/tapestry5/tapestry-core/guide/mixins.html

If you're clear on that, then the only piece you're missing is how to
connect JS to the grid. For that your mixin should instantiate a JS
object and be passed the client side DOM id of the grid. From there it's
in the hands of your JS code. Have a look at the Autocomplete mixin
source, or at these:

(line 67)
http://code.google.com/p/tapestry5-components/source/browse/trunk/commons/src/main/java/org/apache/tapestry/commons/components/SlideShow.java

(line 78)
http://code.google.com/p/tapestry5-components/source/browse/trunk/commons/src/main/java/org/apache/tapestry/commons/mixins/Resizable.java

The first is a component, the other is a mixin. This doesn't matter as
the process for connecting JS to the generated element is the same. See
those indicated lines? That's the glue. Study that for a bit and see if
you can make some progress.

chris

滕训华 wrote:
> Thanks for your reply.
>
> But how to control the tapestry grid component using javascript,can you give
> a example or some materials.
>
> -----邮件原件-----
> 发件人: Chris Lewis [mailto:[EMAIL PROTECTED] 
> 发送时间: 2008年4月10日 13:42
> 收件人: Tapestry users
> 主题: Re: Who can give me some ideas about extending grid component
>
> Yes, you can easily do this with javascript and WITHOUT extending the
> grid by using a mixin.
>
> chris
>
>
> 滕训华 wrote:
>   
>> Hi,erveryone,I want to know whether can I extend the grid function in 5.0.
>>     
> I
>   
>> want to add the follow action:if I select a row of the grid then I change
>> the backcolor of it or double click the row to display a detail page.These
>> functions can be finished by extend the grid through my javascripts and
>>     
> how?
>   
>>  
>>
>>  
>>
>>
>>   
>>     
>
>   

-- 
http://thegodcode.net

Reply via email to