Hi all ! InPlaceEditor refreshes only the element that was updated. Is there any way to make it update tons of other stuff ? I have a table where changing a value in it causes changes in most other cells (weight to percentage to money). Thanks for any help ! -- François Beausoleil http://blog.teksol.info/ _______________________________________________ Rails-spinoffs mailing list Rails-spinoffs-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs
You can pass an onComplete function in options of your control. By default, I think it does something like : new Effect.Highlight(element, {startcolor: this.options.highlightcolor}); Regards, Nicolas On 12/7/05, Francois Beausoleil <francois.beausoleil-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> > Hi all ! > > InPlaceEditor refreshes only the element that was updated. Is there > any way to make it update tons of other stuff ? > > I have a table where changing a value in it causes changes in most > other cells (weight to percentage to money). > > Thanks for any help ! > -- > François Beausoleil > http://blog.teksol.info/ > > _______________________________________________ > 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
Hello Nicolas, 2005/12/7, Nicolas <scalpmail@gmail.com>:> You can pass an onComplete function in options of your control. > By default, I think it does something like : > > new Effect.Highlight(element, {startcolor: this.options.highlightcolor});Thanks, but how does that help me ? In onComplete, I can certainly do a new Ajax call and get the updated values. That would probably work. I was trying to find a way to do only one Ajax call, not two. Thanks ! -- François Beausoleil http://blog.teksol.info/ _______________________________________________ Rails-spinoffs mailing list Rails-spinoffs-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs
Ok, I did''nt understand what you wanted to do. You may have to code your own control here (based on inplaceeditor if you want) that pass more values to the ajax call, and receive more than one answser (using json for example). That''s not very difficult, but it''s definitly not out of the box. Regards Nico On 12/7/05, Francois Beausoleil <francois.beausoleil-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> > Hello Nicolas, > > 2005/12/7, Nicolas <scalpmail-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>: > > You can pass an onComplete function in options of your control. > > By default, I think it does something like : > > > > new Effect.Highlight(element, {startcolor: this.options.highlightcolor > }); > > Thanks, but how does that help me ? In onComplete, I can certainly do > a new Ajax call and get the updated values. That would probably work. > > I was trying to find a way to do only one Ajax call, not two. > > Thanks ! > -- > François Beausoleil > http://blog.teksol.info/ > > _______________________________________________ > 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
Or you can accomplish the one call my stuffing in extra information into the response header. This information will be ignored by the autocomplete and everything else in Prototype and Scriptaculous (leaving it wide open to play with). In Ruby on Rails you can accomplish this by doing: response.headers["data1"]="some string value" response.headers["data2"]="some string value" response.headers["data3"]="some string value" In PHP you can do this: header("data1: some string value"); header("data2: some string value"); header("data3: some string value"); Then you can pull the information out in the onComplete function. Something like (if I remember correctly): onComplete:function(response){alert(response.getResponseHeader ("data1"));} Using JSON you can pass back Javascript structures too. You could also just do a Javascript eval on the data returned too (not recommended). Hope that helps. -John On Dec 7, 2005, at 11:18 PM, Nicolas wrote:> Ok, I did''nt understand what you wanted to do. > You may have to code your own control here (based on inplaceeditor > if you want) that pass more values to the ajax call, and receive > more than one answser (using json for example). > That''s not very difficult, but it''s definitly not out of the box. > > Regards > Nico > > On 12/7/05, Francois Beausoleil < francois.beausoleil-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> > wrote:Hello Nicolas, > > 2005/12/7, Nicolas < scalpmail-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>: > > You can pass an onComplete function in options of your control. > > By default, I think it does something like : > > > > new Effect.Highlight (element, {startcolor: > this.options.highlightcolor}); > > Thanks, but how does that help me ? In onComplete, I can certainly do > a new Ajax call and get the updated values. That would probably work. > > I was trying to find a way to do only one Ajax call, not two. > > Thanks ! > -- > François Beausoleil > http://blog.teksol.info/ > > _______________________________________________ > 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
Hello John, 2005/12/8, John Butler <john@likealightbulb.com>:> Or you can accomplish the one call my stuffing in extra information > into the response header. This information will be ignored by the > autocomplete and everything else in Prototype and Scriptaculous > (leaving it wide open to play with).Thanks for the tip, but that doesn't work for me, it seems. The value length is upwards of 1 Kb, and contains new lines and such. I'm on Rails, and rendering a partial that I used originally to render the table. I guess I'll just have to bite the bullet and do a second Ajax query. Thanks for the info. Bye ! -- François Beausoleil http://blog.teksol.info/ _______________________________________________ Rails-spinoffs mailing list Rails-spinoffs-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs