How about overriding $.end() in the grid plugin, so that it returns the original jquery object if it's run on the grid controller?
Of course, you'd have to remember to make $.end() behave normally if run elsewhere. Or, you could just create an $.endGrid() function for the controller, and not worry about messing with $end() at all. - Brian > 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 > discuss@jquery.com > http://jquery.com/discuss/ > _______________________________________________ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/