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 }
> })
> grid.srollToRow(6)
>
> What is best practice?

How about the Idea to have a jQuery-function that returns the controller 
object:

$('#grid').grid({data:data}).show().gridController().scrollToRow(6);

That way the function that creates the grid does not break the chain, but 
there is a function that returns a controller object. You don't necessarily 
need a way to come back to jQuery if you do it that way, because you can 
chose to get the controller Object later in the queue.

You should think if you want a controller object that can handle mutliple 
grids at the same time:

$('.allmygrids').grid({data:data}).show().gridController().scrollToRow(6);

If not, then gridController() needs to take a parameter to know which of the 
grids you mean:

$('.allmygrids').grid({data:data}).show().gridController(42).scrollToRow(6);

Christof

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

Reply via email to