Re: [jQuery] Designing for reuse

2006-12-02 Thread Jörn Zaefferer
Hi Alan! Thus, jQuery can take the controller centric model and make it lot more powerful. It would be really great if you could put an example showing what you described here. Something to click trough to see it in action. -- Jörn Zaefferer http://bassistance.de

Re: [jQuery] Designing for reuse

2006-12-02 Thread Jörn Zaefferer
Alan Gutierrez schrieb: I'm now growing partial to this convention... $(div.grid).grid() .data(gridData). .columns(2, 3, 7) .select() .sortable() .grid() .rowHeight(22)

Re: [jQuery] Designing for reuse

2006-12-02 Thread Christof Donat
Hi, // imagine yourself some code in these functions. [...] Event.observe($(#switch), 'click', switchViews) I like that. In jQuery-style it could be something like this: jQuery('#switch').bind('click',function() { var showme = jQuery.treeView('#mytree'); var hideme =

Re: [jQuery] Designing for reuse

2006-12-01 Thread Christof Donat
Hi, Controller set of methods is returned.. $('#grid').grid().data(data).drig().show() $('#grid').grid().scrollToRow(6).drig().css(border, 1px) A controller object is returned.. var grid = null $(grid).grid({ data: data, onComplete: function(controller) { grid = controller }

Re: [jQuery] Designing for reuse

2006-12-01 Thread Sam Collett
On 01/12/06, Christof Donat [EMAIL PROTECTED] wrote: Hi, Controller set of methods is returned.. $('#grid').grid().data(data).drig().show() $('#grid').grid().scrollToRow(6).drig().css(border, 1px) A controller object is returned.. var grid = null $(grid).grid({ data:

Re: [jQuery] Designing for reuse

2006-12-01 Thread Christof Donat
Hi, $('#grid').grid({data:data}).show().gridController().scrollToRow(6); An perhaps have a method that returns you back to jQuery object? Calling it 'end' (or any other jQuery method name) may be confusing, something like 'endGrid'. I don't think that is necessary. You could compare it to

Re: [jQuery] Designing for reuse

2006-12-01 Thread Brian Miller
Heh, I should have read this first, before suggesting it myself. *blush* - Brian On 01/12/06, Christof Donat [EMAIL PROTECTED] wrote: Hi, Controller set of methods is returned.. $('#grid').grid().data(data).drig().show() $('#grid').grid().scrollToRow(6).drig().css(border, 1px) A

Re: [jQuery] Designing for reuse

2006-12-01 Thread Sam Collett
On 01/12/06, Brandon Aaron [EMAIL PROTECTED] wrote: If this type of functionality starts to be required I would suggest including a standard way for plugins to easily restore state (.end()) in the core. Destructive methods will be no more in 1.1, so I don't think .end() will be around either.

Re: [jQuery] Designing for reuse

2006-12-01 Thread Alan Gutierrez
I'm fond of the elegance of chaining for manipulating the DOM. The chaining methods of jQuery operate on a set of items and as someone who's landed and getting used to the library and it's idioms the ability to act on all the elements that match a pattern accurately models how I view markup.

Re: [jQuery] Designing for reuse

2006-12-01 Thread Alan Gutierrez
* Brandon Aaron [EMAIL PROTECTED] [2006-12-01 10:16]: On 12/1/06, Sam Collett [EMAIL PROTECTED] wrote: An perhaps have a method that returns you back to jQuery object? Calling it 'end' (or any other jQuery method name) may be confusing, something like 'endGrid'. I don't think using

Re: [jQuery] Designing for reuse

2006-12-01 Thread Alan Gutierrez
* Brian Miller [EMAIL PROTECTED] [2006-12-01 09:05]: Hi, Controller set of methods is returned.. $('#grid').grid().data(data).drig().show() $('#grid').grid().scrollToRow(6).drig().css(border, 1px) A controller object is returned.. var grid = null $(grid).grid({ data:

Re: [jQuery] Designing for reuse

2006-12-01 Thread Alan Gutierrez
* Christof Donat [EMAIL PROTECTED] [2006-12-01 05:28]: Hi, $('#grid').grid({data:data}).show().gridController().scrollToRow(6); An perhaps have a method that returns you back to jQuery object? Calling it 'end' (or any other jQuery method name) may be confusing, something like

Re: [jQuery] Designing for reuse

2006-11-30 Thread Jörn Zaefferer
Alan Gutierrez schrieb: A controller object is returned.. var grid = null $(grid).grid({ data: data, onComplete: function(controller) { grid = controller } }) grid.srollToRow(6) I favor that approach, modified: var gridControl = $(#grid).grid(data);

Re: [jQuery] Designing for reuse

2006-11-30 Thread Alan Gutierrez
* Jörn Zaefferer [EMAIL PROTECTED] [2006-11-30 16:12]: Alan Gutierrez schrieb: A controller object is returned.. var grid = null $(grid).grid({ data: data, onComplete: function(controller) { grid = controller } }) grid.srollToRow(6) I favor that approach, modified:

Re: [jQuery] Designing for reuse

2006-11-30 Thread Dave Methvin
This will be a short thread--NOT! :-) Controller set of methods is returned.. $('#grid').grid().data(data).drig().show() $('#grid').grid().scrollToRow(6).drig().css(border, 1px) Uh, drig()? So if I want to return to I was before scrollToRow(6), should I use (6)woRoTllorsc? ;-) I don't know

Re: [jQuery] Designing for reuse

2006-11-30 Thread Stephen Howard
I know we're all fond of the elegance of chaining, but would it be the least confusing to write it like: var gridControl = new Grid( '#grid' ) where: function Grid( dom_string ) { jQuery( dom_string ).each( function() { instantiate here... } ); ... } Remember not everything needs to

Re: [jQuery] Designing for reuse

2006-11-30 Thread Matt Stith
Remember not everything needs to look like jQuery. Or does it? On 11/30/06, Stephen Howard [EMAIL PROTECTED] wrote: I know we're all fond of the elegance of chaining, but would it be the least confusing to write it like: var gridControl = new Grid( '#grid' ) where: function Grid(

Re: [jQuery] Designing for reuse

2006-11-30 Thread Ⓙⓐⓚⓔ
only when it's better stated in jquery! which is always! On 11/30/06, Matt Stith [EMAIL PROTECTED] wrote: Remember not everything needs to look like jQuery. Or does it? On 11/30/06, Stephen Howard [EMAIL PROTECTED] wrote: I know we're all fond of the elegance of chaining, but would it be

Re: [jQuery] Designing for reuse

2006-11-30 Thread Alan Gutierrez
jQuery is a library that acknowledges the existance of the DOM, and builds on on the DOM. Prototype is a library that focuses on creating controllers, and looks at the DOM more as a templating engine, not a data structure in itself. If all this method does... var grid = $('#grid').grid() ...is