PDA

View Full Version : [CLOSED] One to many grids



registrator
May 01, 2015, 4:52 PM
I have a model that loads through a proxy to a grid. This model has a property List<Items> SubItems I would like to load these sub items in a separate grid bellow.
I have tried with
.Listeners(l => l.SelectionChange.Handler = "selected.length && #{subGrid}.bindStore(selected[0].SubItems);"),

but this doesn't work. But something along those line I would like to have.
Can you please help? Everything is loaded in the top grid store.

Daniil
May 04, 2015, 9:19 PM
Hi @registrator,

At very least, you should replace
selected[0].SubItems
with
selected[0].data.SubItems

Though, you should ensure SubItems are really loaded to the Store.

registrator
May 05, 2015, 7:19 AM
Hi Daniil

It is still the same when I add .data
The error seen in the browser is



Uncaught TypeError: Cannot read property 'on' of undefinedaddManagedListener @ ext.axd?v=1895:18addManagedListener @ ext.axd?v=1895:18(anonymous function) @ ext.axd?v=1895:18Ext.cmd.derive.bindStore @ ext.axd?v=1895:18Ext.net.addTo.items.items.items.i tems.listeners.selectionchange.fn @ VM602:1fire @ ext.axd?v=1895:18Ext.util.DirectObservable.continu eFireEvent @ ext.axd?v=1895:27(anonymous function) @ ext.axd?v=1895:18Ext.util.DirectObservable.fireEve ntArgs @ ext.axd?v=1895:25Ext.Component.fireEventArgs @ ext.axd?v=1895:56createRelayer @ ext.axd?v=1895:18fire @ ext.axd?v=1895:18Ext.util.DirectObservable.continu eFireEvent @ ext.axd?v=1895:27(anonymous function) @ ext.axd?v=1895:18Ext.util.DirectObservable.fireEve ntArgs @ ext.axd?v=1895:25(anonymous function) @ ext.axd?v=1895:18Ext.util.DirectObservable.fireEve nt @ ext.axd?v=1895:25(anonymous function) @ ext.axd?v=1895:18Ext.cmd.derive.maybeFireSelection Change @ ext.axd?v=1895:18Ext.cmd.derive.doSingleSelect @ ext.axd?v=1895:18Ext.cmd.derive.doSelect @ ext.axd?v=1895:18Ext.cmd.derive.selectWithEvent @ ext.axd?v=1895:18Ext.cmd.derive.processSelection @ ext.axd?v=1895:18Ext.cmd.derive.onRowMouseDown @ ext.axd?v=1895:18fire @ ext.axd?v=1895:18Ext.util.DirectObservable.continu eFireEvent @ ext.axd?v=1895:27(anonymous function) @ ext.axd?v=1895:18Ext.util.DirectObservable.fireEve ntArgs @ ext.axd?v=1895:25Ext.Component.fireEventArgs @ ext.axd?v=1895:56Ext.util.DirectObservable.fireEve nt @ ext.axd?v=1895:25(anonymous function) @ ext.axd?v=1895:18Ext.cmd.derive.processUIEvent @ ext.axd?v=1895:18b.implement.callParent @ ext.axd?v=1895:18Ext.view.Table.override.processUI Event @ ext.axd?v=1895:1460Ext.cmd.derive.handleEvent @ ext.axd?v=1895:18(anonymous function) @ VM585:5Ext.apply.createListenerWrap

Daniil
May 05, 2015, 11:15 AM
Please provide a test case.

registrator
May 05, 2015, 9:07 PM
I will try to create a separate example in a separate project.