关于我们

质量为本、客户为根、勇于拼搏、务实创新

< 返回新闻公共列表

easyui运用js在数据字典中获取值

发布时间:2019-10-23 09:01:44
var CRUD = {
    add: function () {
        var hDialog = top.jQuery.hDialog({
            title: '添加', width: 800, height: 600, href: formurl, iconCls: 'icon-add',
            //初始化添加
            onLoad: function () {
                //数据字典中获取值
                top.$('#txt_fenlei').combobox({ url: '/sys/ashx/dichandler.ashx?categoryId=105', valueField: 'Title', textField: 'Title', editable: false, required: true, missingMessage: '', disabled: false });

                top.$('.kindeditor').kindeditor();//初始化kingdeditor编辑器
            },
            submit: function () {
                //alert(top.$("#uiform").form('enableValidation').form('validate'));
                //alert(top.$("#uiform").form('validate'));
                //原来用的是这种方法 alert(top.$('#uiform').validate().form());
                if (top.$("#uiform").form('validate')) {
                    var query = createParam('add', '0');
                    jQuery.ajaxjson(actionURL, query, function (d) {
                        if (parseInt(d) > 0) {
                            msg.ok('添加成功!');
                            hDialog.dialog('close');
                            grid.reload(top.$('#txt_fenlei').combobox('getValue'));
                        } else {
                            MessageOrRedirect(d);
                        }
                    });
                }
                msg.warning('请填写必填项!');
                return false;
            }
        });



/template/Home/Zkeys/PC/Static