* 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:
> 
> var gridControl = $("#grid").grid(data);
> gridControl.scrollToRow(6);
> 
> I don't mind breaking the chain in that case.
> 
> The nice thing: You can still use jQuery's documentation system when 
> writing your own objects and methods.
> 
> It would be nice to hear other's opinions on this topic, in the end, 
> more stuff for the plugin authoring guide may be the result.

I'm very interested to hear more ideas. The documentation system is
attached only to jQuery.fn I take it.

After writing about it, I gave the method chaining solutions some
more thought, I guess because they seem more jQuery like. Some of
the problems I had with it started to explain themselves.

// return dimesions of the first grid
var h = $("#grid").grid(0).rowHeight

// ..or
var h = $("#grid").grid().rowHeight()

// apply to all grids
$("#grid").grid().disableColumn(2).rowHeight('22px').drig().width('300px')

// maybe this reads better...
$("#grid").grid().disableColumn(2).rowHeight('22px').jQuery().width('300px')

// does it get out of hand?
$("#grid").grid()
          .columns(2, 5, 6).select().grid()
          .rowHeight('22px')
          .jQuery().width('300px')

-- 
Alan Gutierrez - 504 717 1428 - [EMAIL PROTECTED] - http://blogometer.com/
                Think New Orleans - http://thinknola.com/

_______________________________________________
jQuery mailing list
[email protected]
http://jquery.com/discuss/

Reply via email to