D
D
Dmitry2014-07-13 07:20:31
JavaScript
Dmitry, 2014-07-13 07:20:31

How to solve problem with forms in ExtJS?

Good afternoon!
There is a form:

var tovar_window = Ext.create('Ext.window.Window', {
    title:"Заголовок",
    height:300,
    width:500,
    items: [
        {
            xtype:'grid',
            title:"Список товаров",
            columns: [
                {
                    text:"ID",
                    dataIndex: "device_vendor_id"
                },
                {
                    text: "Название",
                    dataIndex: "device_full_name"
                },
                {
                    text: "Популярность",
                    dataIndex: "popular"
                },
                {
                    text: "Зарядка",
                    dataIndex: "charger"
                },
                {
                    text: "Акб",
                    dataIndex: "akb"
                }
            ]
        }
    ]
})

Called like this:
var toolbar_tovar_menu  = Ext.create("Ext.menu.Menu", {
            items: [
                {
                    text: "Товары",
                    handler: function() {
                        tovar_window.show();
                    }
                },
.....

On the first call, the form opens normally, on the second call, only a blue frame is visible.
Do I understand correctly that in order to call multiple instances of the same form, you need to add it to an array with a unique name? Or is there another way to solve this problem?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Sergey Voronkov, 2014-07-24
@no_smoking

If the window was closed, then all tags are destroyed, i.e. it cannot be used when pressed again. Exit 2 either create a new window with the form each time or set the closeAction: 'hide' parameter for the window so that it is hidden, not destroyed as it is by default

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question