NET Rapid Informatization System Development Framework V3.2-> Web User Management Module Editorial Interface-Organization Selection Support Cascade Selection

The drop-down box cascade selection function is very practical. The framework user management editing interface adds cascade selection support to the organization selection in version 3.2, which makes the organization selection more convenient and efficient, and is not easy to make mistakes.

The organizational structure of our framework is divided into five types according to the actual situation: company, branch, department, sub-department and working group. Different enterprises can choose or reject according to their actual needs. The organizational selection control of user editing interface uses the combobox control of EasyUI, and the onChange event of this control is mainly used in cascade selection.

The cascade selection effect is shown in the following figure:


The following is a code reference for adding the user JS section.

AddUser: function () { //Add user
        var addDialog = top.$.hDialog({
            href: formUrl,
            title: 'Add user',
            width: 610,
            height: 640,
            iconCls: 'icon16_user_add',
            onLoad: function () {
                UserAdminMethod.initData();
                BindOrganize();
                top.$('#Enabled').attr("checked", true);
                top.$('#Description').val("");
                top.$('#UserName').focus();
            },
            submit: function () {
                if (top.$('#uiform').validate().form()) {                    
                    var postData = pageMethod.serializeJson(top.$('#uiform'));
                    postData.CompanyName = top.$('#CompanyId').combobox('getText');
                    postData.SubCompanyName = top.$('#SubCompanyId').combobox('getText');
                    postData.DepartmentName = top.$('#DepartmentId').combobox('getText');
                    postData.SubDepartmentName = top.$('#SubDepartmentId').combobox('getText');
                    postData.WorkgroupName = top.$('#WorkgroupId').combobox('getText');
                    $.ajaxjson("/FrameworkModules/UserAdmin/SubmitForm", postData, function (d) {
                        if (d.Success) {
                            msg.ok(d.Message);
                            addDialog.dialog('close');
                            mygrid.reload();
                        } else {
                            MessageOrRedirect(d);
                        }
                    });
                } else {
                    msg.warning('Please enter a user name.');
                    top.$('#UserName').focus();
                }
            }
        });
        return false;
    }

Binding organization cascade binding code reference:

function BindOrganize() {
    top.$('#SubCompanyId,#DepartmentId,#SubDepartmentId,#WorkgroupId').combobox({
        valueField: 'Id', textField: 'FullName', panelHeight: 100, editable: true
    });
    top.$('#CompanyId').combobox({
        valueField: 'ID', textField: 'FULLNAME', panelHeight: 100, editable: true,
        url: '/FrameworkModules/OrganizeAdmin/GetOrganizeByCategory?organizeCategory=Company',
        onChange: function (newValue, oldValue) {
            top.$('#SubCompanyId').combobox({
                url: '/FrameworkModules/OrganizeAdmin/GetCategoryChildrensById?organizeCategory=SubCompany&organzieId=' + newValue,
                onChange: function(newValue, oldValue) {
                    top.$('#DepartmentId').combobox({
                        url: '/FrameworkModules/OrganizeAdmin/GetCategoryChildrensById?organizeCategory=Department&organzieId=' + newValue
                    });
                    
                    top.$('#DepartmentId').combobox({
                        url: '/FrameworkModules/OrganizeAdmin/GetCategoryChildrensById?organizeCategory=Department&organzieId=' + newValue
                    });

                    top.$('#SubDepartmentId').combobox({
                        url: '/FrameworkModules/OrganizeAdmin/GetCategoryChildrensById?organizeCategory=SubDepartment&organzieId=' + newValue
                    });

                    top.$('#WorkgroupId').combobox({
                        url: '/FrameworkModules/OrganizeAdmin/GetCategoryChildrensById?organizeCategory=WorkGroup&organzieId=' + newValue
                    });
                }
            });
        }
    });
}

Related articles:

     RDIFramework Platform Code Generator V3.2 Release 

   RDIFramework.NET-Framework for Rapid Information System Development Based on.NET-Series Catalogues  

   RDIFramework.NET NET Rapid Informatization System Development Framework Introduction of Workflow Components 

Thank you RDIFramework for years .NET Supporters and users of the framework can find out the details through the following address.  

      RDIFramework.net Official website: http://www.rdiframework.net/ 

      RDIFramework.Net Official Blog: http://blog.rdiframework.net/ 

At the same time, all future technical articles should be based on the official website, welcome to collect!  

      RDIFramework.NET The framework has been built, updated and upgraded by professional team for a long time. Please be assured to use it! uuuuuuuuuu   

Welcome to RDIFramework .net Framework Official Public WeChat(WeChat No. rdiframework-net, keep abreast of the latest developments.

Scanning 2-D codes for immediate attention

 

Posted by BenProl on Sat, 05 Jan 2019 23:48:08 -0800