PDA

View Full Version : Multiple instance of a controller/view



dblv
20 Nov 2012, 5:44 AM
Hi,
I'm writing (trying to write !) a app in MVC model.
All my views are extensions of Ext.window.Window.

I have a window with a grid (Ex. : list of customers) and i want to open two different records in two different windows (but it's the same controller/view).

So, I have this message :


Message : Registering duplicate id "fieldname" with this manager
Ligne : 18
Caractère : 63920
Code : 0
URI : http://localhost/g10w/extjs/ext.js

Is there a solution ?
Thanks (and excuse me for my bad English language !)

nothing
20 Nov 2012, 6:50 AM
Hi,

you can use lid instead of id.

Give every item an lid, say lid='abc'.

Then from each window, call this to get the item:


myWindow.query('[lid=abc]')[0]

dblv
20 Nov 2012, 7:24 AM
It's works fine !
Thank you very much, you save my life !

dblv
21 Nov 2012, 5:20 AM
I've got a new problem with my multi-instance :

In the controller of my window containing my grid (list of customers), I have got an event for itemDblClick.
This event call this method :


modifClient function(oGrid,oRecord) {
Ext.widget("clisaisie",{lid: "clisaisie_"+oRecord.data.ident.toString()}).showAt(150,150);
}


This works (windows are opened) but it's impossible to close my windows with the small button on right top.

An idea ?

nothing
21 Nov 2012, 5:43 AM
Start a new thread. Post more code and is there an error msg?