private void __clickItem(EventContext context)
        {
            if (dropdown.parent is GRoot)
            {
                ((GRoot)dropdown.parent).HidePopup(dropdown);
            }
            _selectedIndex     = int.MinValue;
            this.selectedIndex = _list.GetChildIndex((GObject)context.data);

            DispatchEvent("onChanged", null);
        }
Exemple #2
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="name"></param>
        /// <returns></returns>
        public bool RemoveItem(string name)
        {
            GComponent item = _list.GetChild(name).asCom;

            if (item != null)
            {
                int index = _list.GetChildIndex(item);
                _list.RemoveChildToPoolAt(index);
                return(true);
            }
            else
            {
                return(false);
            }
        }
        /// <summary>
        ///
        /// </summary>
        /// <param name="name"></param>
        public void RemoveItem(string name)
        {
            GComponent item = _list.GetChild(name).asCom;

            if (item != null)
            {
                item.RemoveEventListeners(EVENT_TYPE);
                if (item.data is PopupMenu)
                {
                    ((PopupMenu)item.data).Dispose();
                    item.data = null;
                }
                int index = _list.GetChildIndex(item);
                _list.RemoveChildToPoolAt(index);
            }
        }
        private void __clickItem(EventContext context)
        {
            if (dropdown.parent is GRoot)
            {
                ((GRoot)dropdown.parent).HidePopup(dropdown);
            }
            _selectedIndex = _list.GetChildIndex((GObject)context.data);
            if (_selectedIndex >= 0)
            {
                this.text = _items[_selectedIndex];
            }
            else
            {
                this.text = string.Empty;
            }

            onChanged.Call();
        }