Esempio n. 1
0
        protected void GroupStore_Change(object sender, DirectEventArgs e)
        {
            if (string.IsNullOrEmpty(hdfGroupID.Text))
            {
                return;
            }
            FormGroupInfo          groupInfo   = FormGroupController.GetInstance().Get(int.Parse(hdfGroupID.Text));
            List <FormElementInfo> columnfield = groupInfo.GetFormElements(1);
            string menuStr = "<li style='display:none;'></li>";

            foreach (FormElementInfo field in columnfield)
            {
                menuStr = string.Concat(menuStr,
                                        string.Format("<li id='{0}'>{1}<b onclick=RemoveField('{2}')>.</b></li>", field.ID.ToString(),
                                                      field.LabelName, field.ID.ToString()));
            }

            string output = @" <div class='demo'>
                            <ul id='sortable'>
                             {0}
                            </ul>
                           </div>";

            lblOutput.Html             = string.Format(output, menuStr);
            txtGroupTitle.Text         = groupInfo.Title;
            txtWidth.Text              = groupInfo.Width.ToString();
            txtHeight.Text             = groupInfo.Height.ToString();
            cbFormLayout.SelectedIndex = (groupInfo.Layout == "RowLayout") ? 0 : 1;
            chkDisplayText.Checked     = groupInfo.DisplayText;
            chkIsTab.Checked           = groupInfo.IsTab;
            for (int i = 0; i < 3; i++)
            {
                if (groupInfo.LabelAlign.Equals(cbLabelAlign.Items[i].Value))
                {
                    cbLabelAlign.SelectedIndex = i;
                    break;
                }
            }

            if (groupInfo.ParentID != 0)
            {
                int index = 0;
                foreach (Ext.Net.ListItem item in cbGroup2.Items)
                {
                    if (item.Value == groupInfo.ParentID.ToString())
                    {
                        cbGroup2.SelectedIndex = index++;
                        cbGroup2.SetValue(groupInfo.ParentID);
                        break;
                    }
                }
            }
            else
            {
                cbGroup2.Clear();
            }

            hdfCommand.Text = "update";
        }
Esempio n. 2
0
    /// <summary>
    /// lấy các phần tử(control) trong nhóm đưa lên tree
    /// </summary>
    /// <param name="parent"></param>
    /// <param name="group"></param>
    private void LoadControl(Ext.Net.TreeNode parent, FormGroupInfo group)
    {
        List <FormElementInfo> element = group.GetFormElements(1);

        if (element.Count() == 0)
        {
            parent.Expanded = true;
        }
        else
        {
            foreach (FormElementInfo item in element)
            {
                Ext.Net.TreeNode node = new Ext.Net.TreeNode();
                node.Text   = item.LabelName + "_";
                node.NodeID = item.ID.ToString();
                node.Leaf   = true;
                // node.Disabled = true;
                parent.Nodes.Add(node);
            }
        }
    }