normMenu(menu, options = {}) {
        if (Array.isArray(menu)) {
            menu.forEach((it, m) => {
                if (typeof it === 'string' || typeof it === 'number') {
                    menu[m] = { id: it, text: String(it) }
                } else if (it != null) {
                    if (options.itemMap != null) {
                        let val = w2utils.getNested(it, options.itemMap.id)
                        if (options.itemMap.id != null && val != null) {
                            it.id = val
                        }
                        val = w2utils.getNested(it, options.itemMap.text)
                        if (options.itemMap.text != null && val) {
                            it.text = val
                        }
                    }
                    if (it.caption != null && it.text == null) it.text = it.caption
                    if (it.text != null && it.id == null) it.id = it.text
                    if (it.text == null && it.id != null) it.text = it.id
                } else {
                    menu[m] = { id: null, text: 'null' }
                }
            })
            return menu
        } else if (typeof menu === 'function') {
            let newMenu = menu.call(this, menu, options)
            return w2utils.normMenu.call(this, newMenu, options)
        } else if (typeof menu === 'object') {
            return Object.keys(menu).map(key => { return { id: key, text: menu[key] } })
        }
    }
Takes a menu (used in drop downs, context menu, field: list/combo/enum) and normalizes it to the common structure, which
is { id: ..., text: ... }. In options you can pass { itemMap: { id: 'id_field', text: 'text_field' }} that will be used
to find out id and text fields.