Hi Lindsey, Without looking at the internals of your app... if you''re building up a table and assigning event handlers to every row, you could make it quicker by assigning one event handler to the entire table, which then figures out which row was clicked (using Event.element, for example) and acts appropriately. The event handler will need to be a bit more complicated, but if you''re having problems with the onload time, it might make a big difference. HTH Dave On Friday 09 June 2006 16:27, Lindsey Simon wrote:> Is there any particularly fast way for > assigning all the events to prevent that slowdown time onload? >
See this post for a test page / test case for using XSLT to produce an Ajax Datagrid widget: http://development.finetooth.com/?p=15 - I''d like to find some other XSLT/JavaScript developers out there who are interested in this approach as well! I used prototype/scriptaculous in my widget and I''ve posted about it before. What''s neat about this page is the client-side implemenation of XSLT to actually create the thing from semantically proper xhtml markup instead of some serverside object or from JavaScript code. -- Lindsey Simon lsimon-kAMMLXQ8Af9Wk0Htik3J/w@public.gmane.org Key fingerprint = C6A9 B9D9 677E A631 3E7F 43BF 5E2F 77F1 A33C B117 Public Key: http://www.commoner.com/pubkey.asc
Neat, and has it''s place, but I''m not sure about it''s scaleability or utility as a catch-all widgetry engine. Try 200 rows. Via client side XSLT I get a "script is taking too long" alert in FF. Via server side XSLT it takes a while (longer than I would expect for 200 rows). 200 rows isn''t a lot of data (at least not the data set represented on the demo page). Maybe it can be tweaked though. But personally I think maybe XSLT is better suited for something like skinning. I noticed in your XSLT file you are attaching a bunch of event handlers inline. Have you made any XSLT widgets yet where the behavior/event wiring is de-coupled from the presentation? On 6/9/06, Lindsey Simon <lsimon-kAMMLXQ8Af9Wk0Htik3J/w@public.gmane.org> wrote:> > > See this post for a test page / test case for using XSLT to produce an > Ajax Datagrid widget: http://development.finetooth.com/?p=15 - I''d like > to find some other XSLT/JavaScript developers out there who are > interested in this approach as well! > > I used prototype/scriptaculous in my widget and I''ve posted about it > before. What''s neat about this page is the client-side implemenation of > XSLT to actually create the thing from semantically proper xhtml markup > instead of some serverside object or from JavaScript code. > > -- > > Lindsey Simon > lsimon-kAMMLXQ8Af9Wk0Htik3J/w@public.gmane.org > Key fingerprint = C6A9 B9D9 677E A631 3E7F 43BF 5E2F 77F1 A33C B117 > Public Key: http://www.commoner.com/pubkey.asc > _______________________________________________ > Rails-spinoffs mailing list > Rails-spinoffs-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs >_______________________________________________ Rails-spinoffs mailing list Rails-spinoffs-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs
It''s definitely no big deal to decouple it - I didn''t here because I hadn''t originally, so that''s just a matter of adding some event assignment to the onload function. Originally, I was opposed to doing any of this in the DOM because assigning all the events itself was so slow. Yeah, I question the scalability as well, and I wonder how much can be improved by a faster stylesheet. Right now the serverside component is my box at home, at some point today it''ll have a real server backend - 200 rows on the server takes no time via the xslt, so that will show up better ;) Is there any particularly fast way for assigning all the events to prevent that slowdown time onload? Ryan Gahl in message Re: [Rails-spinoffs] XSLT Ajax Widget implementation (Fri, 06/09 09:39):> Neat, and has it''s place, but I''m not sure about it''s scaleability or > utility as a catch-all widgetry engine. Try 200 rows. Via client side XSLT I > get a "script is taking too long" alert in FF. Via server side XSLT it takes > a while (longer than I would expect for 200 rows). 200 rows isn''t a lot of > data (at least not the data set represented on the demo page). > > Maybe it can be tweaked though. But personally I think maybe XSLT is better > suited for something like skinning. I noticed in your XSLT file you are > attaching a bunch of event handlers inline. Have you made any XSLT widgets > yet where the behavior/event wiring is de-coupled from the presentation? > > > > > On 6/9/06, Lindsey Simon <lsimon-kAMMLXQ8Af9Wk0Htik3J/w@public.gmane.org> wrote: > > > > > >See this post for a test page / test case for using XSLT to produce an > >Ajax Datagrid widget: http://development.finetooth.com/?p=15 - I''d like > >to find some other XSLT/JavaScript developers out there who are > >interested in this approach as well! > > > >I used prototype/scriptaculous in my widget and I''ve posted about it > >before. What''s neat about this page is the client-side implemenation of > >XSLT to actually create the thing from semantically proper xhtml markup > >instead of some serverside object or from JavaScript code. > > > >-- > > > >Lindsey Simon > >lsimon-kAMMLXQ8Af9Wk0Htik3J/w@public.gmane.org > >Key fingerprint = C6A9 B9D9 677E A631 3E7F 43BF 5E2F 77F1 A33C B117 > >Public Key: http://www.commoner.com/pubkey.asc > >_______________________________________________ > >Rails-spinoffs mailing list > >Rails-spinoffs-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > >http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs > >> _______________________________________________ > Rails-spinoffs mailing list > Rails-spinoffs-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs-- Lindsey Simon lsimon-kAMMLXQ8Af9Wk0Htik3J/w@public.gmane.org Key fingerprint = C6A9 B9D9 677E A631 3E7F 43BF 5E2F 77F1 A33C B117 Public Key: http://www.commoner.com/pubkey.asc
Hey Ryan, check out the new button that does the clientside XSLT using the Sarissa library. Try the 200 rows, and notice how lightning fast it is w/ Sarissa. I think Sarissa uses the native xsl engine, but anyhow, it is really swift! Ryan Gahl in message Re: [Rails-spinoffs] XSLT Ajax Widget implementation (Fri, 06/09 09:39):> Neat, and has it''s place, but I''m not sure about it''s scaleability or > utility as a catch-all widgetry engine. Try 200 rows. Via client side XSLT I > get a "script is taking too long" alert in FF. Via server side XSLT it takes > a while (longer than I would expect for 200 rows). 200 rows isn''t a lot of > data (at least not the data set represented on the demo page). > > Maybe it can be tweaked though. But personally I think maybe XSLT is better > suited for something like skinning. I noticed in your XSLT file you are > attaching a bunch of event handlers inline. Have you made any XSLT widgets > yet where the behavior/event wiring is de-coupled from the presentation? > > > > > On 6/9/06, Lindsey Simon <lsimon-kAMMLXQ8Af9Wk0Htik3J/w@public.gmane.org> wrote: > > > > > >See this post for a test page / test case for using XSLT to produce an > >Ajax Datagrid widget: http://development.finetooth.com/?p=15 - I''d like > >to find some other XSLT/JavaScript developers out there who are > >interested in this approach as well! > > > >I used prototype/scriptaculous in my widget and I''ve posted about it > >before. What''s neat about this page is the client-side implemenation of > >XSLT to actually create the thing from semantically proper xhtml markup > >instead of some serverside object or from JavaScript code. > > > >-- > > > >Lindsey Simon > >lsimon-kAMMLXQ8Af9Wk0Htik3J/w@public.gmane.org > >Key fingerprint = C6A9 B9D9 677E A631 3E7F 43BF 5E2F 77F1 A33C B117 > >Public Key: http://www.commoner.com/pubkey.asc > >_______________________________________________ > >Rails-spinoffs mailing list > >Rails-spinoffs-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > >http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs > >> _______________________________________________ > Rails-spinoffs mailing list > Rails-spinoffs-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs-- Lindsey Simon lsimon-kAMMLXQ8Af9Wk0Htik3J/w@public.gmane.org Key fingerprint = C6A9 B9D9 677E A631 3E7F 43BF 5E2F 77F1 A33C B117 Public Key: http://www.commoner.com/pubkey.asc
Hey Ryan and group, Alrighty - try now in IE it works for me. Can you test with Safari (do you have a Mac?) - Sarissa is a js lib, online at: http://sarissa.sourceforge.net/doc/ At this point, the meaningful test is only the first transform after fetching the data. I still need to fix a few things in the grid to work with this technique, but that''s not going to be too tough. I think I''m reasonably satisfied by the speed of Sarissa to continue developing along this path. -l http://development.finetooth.com/?p=15 Ryan Gahl in message Re: [Rails-spinoffs] XSLT Ajax Widget implementation (Tue, 06/13 17:41):> Wow! > > That is very fast. But it seems to only be working in FF. Is Sarissa a > chrome thing? IE just does nothing when I click the Sarissa button. > > But, definitely getting closer. > > > > On 6/13/06, Lindsey Simon <lsimon-kAMMLXQ8Af9Wk0Htik3J/w@public.gmane.org> wrote: > > > >Hey Ryan, check out the new button that does the clientside XSLT using > >the Sarissa library. Try the 200 rows, and notice how lightning fast it > >is w/ Sarissa. I think Sarissa uses the native xsl engine, but anyhow, > >it is really swift! > > > >Ryan Gahl in message Re: [Rails-spinoffs] XSLT Ajax Widget implementation > >(Fri, 06/09 09:39): > > > >> Neat, and has it''s place, but I''m not sure about it''s scaleability or > >> utility as a catch-all widgetry engine. Try 200 rows. Via client side > >XSLT I > >> get a "script is taking too long" alert in FF. Via server side XSLT it > >takes > >> a while (longer than I would expect for 200 rows). 200 rows isn''t a lot > >of > >> data (at least not the data set represented on the demo page). > >> > >> Maybe it can be tweaked though. But personally I think maybe XSLT is > >better > >> suited for something like skinning. I noticed in your XSLT file you are > >> attaching a bunch of event handlers inline. Have you made any XSLT > >widgets > >> yet where the behavior/event wiring is de-coupled from the presentation? > >> > >> > >> > >> > >> On 6/9/06, Lindsey Simon <lsimon-kAMMLXQ8Af9Wk0Htik3J/w@public.gmane.org> wrote: > >> > > >> > > >> >See this post for a test page / test case for using XSLT to produce an > >> >Ajax Datagrid widget: http://development.finetooth.com/?p=15 - I''d like > >> >to find some other XSLT/JavaScript developers out there who are > >> >interested in this approach as well! > >> > > >> >I used prototype/scriptaculous in my widget and I''ve posted about it > >> >before. What''s neat about this page is the client-side implemenation of > >> >XSLT to actually create the thing from semantically proper xhtml markup > >> >instead of some serverside object or from JavaScript code. > >> > > >> >-- > >> > > >> >Lindsey Simon > >> >lsimon-kAMMLXQ8Af9Wk0Htik3J/w@public.gmane.org > >> >Key fingerprint = C6A9 B9D9 677E A631 3E7F 43BF 5E2F 77F1 A33C B117 > >> >Public Key: http://www.commoner.com/pubkey.asc > >> >_______________________________________________ > >> >Rails-spinoffs mailing list > >> >Rails-spinoffs-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > >> >http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs > >> > > > > >> _______________________________________________ > >> Rails-spinoffs mailing list > >> Rails-spinoffs-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > >> http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs > > > > > >-- > > > >Lindsey Simon > >lsimon-kAMMLXQ8Af9Wk0Htik3J/w@public.gmane.org > >Key fingerprint = C6A9 B9D9 677E A631 3E7F 43BF 5E2F 77F1 A33C B117 > >Public Key: http://www.commoner.com/pubkey.asc > >-- Lindsey Simon lsimon-kAMMLXQ8Af9Wk0Htik3J/w@public.gmane.org Key fingerprint = C6A9 B9D9 677E A631 3E7F 43BF 5E2F 77F1 A33C B117 Public Key: http://www.commoner.com/pubkey.asc
What are the differences between <a href="#" value="Register" onclick="<%= remote_function(:update => "title_login", :url => { :action => :register })%>;">Link Here</a> and using <%= link_to "Link Here", :action => "register" %> with register.rjs which contains the code page.replace_html "title_login", "blah blah blah" Are there any performance differences between using rjs vs. remote_function? What are the advantages/disadvantages? Thanks, Ben Lisbakken
to correct myself, instead of> <%= link_to "Link Here", :action => "register" %> >i meant <%= link_to_remote("Link Here", :url => (:action => :register) %> On Jun 15, 2006, at 10:54 PM, Ben Lisbakken wrote:> What are the differences between > > <a href="#" value="Register" onclick="<%= remote_function(:update > => "title_login", :url => { :action => :register })%>;">Link Here</a> > > and using > <%= link_to "Link Here", :action => "register" %> > with register.rjs which contains the code > page.replace_html "title_login", "blah blah blah" > > Are there any performance differences between using rjs vs. > remote_function? What are the advantages/disadvantages? > > Thanks, > Ben Lisbakken > _______________________________________________ > Rails-spinoffs mailing list > Rails-spinoffs-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs
On 16.6.2006, at 9.03, Ben Lisbakken wrote:> to correct myself, instead of > >> <%= link_to "Link Here", :action => "register" %> >> > i meant > <%= link_to_remote("Link Here", :url => (:action => :register) %> > > On Jun 15, 2006, at 10:54 PM, Ben Lisbakken wrote: > >> What are the differences between >> >> <a href="#" value="Register" onclick="<%= remote_function(:update >> => "title_login", :url => { :action => :register })%>;">Link >> Here</a> >> >> and using >> <%= link_to "Link Here", :action => "register" %> >> with register.rjs which contains the code >> page.replace_html "title_login", "blah blah blah" >> >> Are there any performance differences between using rjs vs. >> remote_function? What are the advantages/disadvantages?You should never use the update parameter when using rjs templates. I''m not sure if you meant that, but you call the register action in the first example, too, so I just thought to mention that. But let''s say you knew that, and in the first case you just render a partial template from the register action. In your particular case, there''s not much difference. In the first case, Ajax.Updater is used instead of Ajax.Request on the JS level, but if all you care about is to update a page element, that doesn''t mean anything to you. In that case, the register action returns the partial rendered as text/html to the ajax call. In the rjs case, text/javascript is returned with the rjs commands interpreted to Javascript. You start to get more advantage of the rjs templates when you want to do more complex things within the page, e.g. highlight one element, update a subtotal somewhere else on the page etc, etc. So in your case you can as well use the :update parameter. However, you can do that as well using link_to_remote, there is no need to write the anchor tag by hand there, either. //jarkko -- Jarkko Laine http://jlaine.net http://odesign.fi _______________________________________________ Rails-spinoffs mailing list Rails-spinoffs-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs
Hey Dave, so I re-engineered the event listeners to get registered on initialization in js - and used basically the technique you describe. So thanks ;) -l http://development.finetooth.com/?p=15 Dave Crane in message Re: [Rails-spinoffs] XSLT Ajax Widget implementation (Fri, 06/09 09:42):> Hi Lindsey, > > Without looking at the internals of your app... if you''re building up a table > and assigning event handlers to every row, you could make it quicker by > assigning one event handler to the entire table, which then figures out which > row was clicked (using Event.element, for example) and acts appropriately. > The event handler will need to be a bit more complicated, but if you''re > having problems with the onload time, it might make a big difference. > > > HTH > > Dave > > > On Friday 09 June 2006 16:27, Lindsey Simon wrote: > > Is there any particularly fast way for > > assigning all the events to prevent that slowdown time onload? > > > _______________________________________________ > Rails-spinoffs mailing list > Rails-spinoffs-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs