2

I have:enter image description here

1.) What should I type in this.control() for getting the reference to the grid panel?

My plan is, when user double clicks one row, new tab is created. I already have code for creating new tabs but I just need to get reference to the grid panel.

Something like this:

'viewport > westpanel > accordion > gridpanel': {
   doubleclick: function...
}

2.) Let's say that I gave an ID to the grid panel. How can I get reference in this.control using .get method?

3.) How can I be sure that I've got the right reference? Can I console.log() - it or something like that?

I would know how to do this without MVC but here I need help. :)

Thank you! :)

1 Answers1

0

It is quite easy once you understand how to use it. First you should read the API about the ComponentQuery cause that is what is used within the control.

  1. this depends on your components. You so can go by the xtype 'panel > grid': {itemdblclick:this.yourCallback}

  2. the recommend way if you can't define a really unique path by xtypes '#myID': {itemdblclick:this.yourCallback} using defined refs within the control is not possible in the currently release, as far as I know.

  3. Use Id's instead of just xtypes '#myID > grid': {itemdblclick:this.yourCallback} or define additional params '#myID > grid[customProp=identString]': {itemdblclick:this.yourCallback}

sra
  • 23,820
  • 7
  • 55
  • 89
  • it is recommended to NOT use ids in extjs – Neil McGuigan Sep 13 '12 at 18:46
  • You could say the same for any other HTML site... It is only not recommend cause a auto-Id system is saver than programmers who write them. But if you use a Id system that is based on a strong convention there is no problem doing so. ExtJS create a Id for each component if there is no Id already setted by the user. – sra Sep 14 '12 at 07:05