Some tips layui development

Personnel selection function

 // save selected results for the callback 
        / *
        window.saveSelectTeachers = function () {
            // 1, check the user what the final choice is
            var rule_course_id = storage.getItem("rule_course_id");
            // 2, save
            , data = {
                "select_person_id_array": storage.getItem(select_person_id_array),
                "rule_course_id": rule_course_id,
            };
            $.ajax({
                type: "POST",
                dataType: "json",
                async: false,
                date: date,
                url: "/baseService/teachbase/saveRuleCourseTeacher",
                success: function (data) {
                    layer.msg("保存成功", {icon: 1, time: 1000, shade: [0.5, '#000', true]}, function () {
                        layui.table.reload('idTest', {
                            where: {}
                        });
                        // define reload tips
                        setTimeout("bindTips()", 200);
                    });
                }
            });
        };
         */

 

// business requirements, there can not be configured teacher! ! Abandoned, but because the code selection of personnel is useful, it is not deleted. 
            / *
            if (obj.event === "setTeacher") {
                // 1, according to which teachers acquired business has been set up this course teachers
                $.ajax({
                    type: "GET",
                    dataType: "json",
                    async: false,
                    url: "/baseService/teachbase/selectedTeacher?rule_course_id=" + obj.data.id,
                    success: function (data) {
                        There _d = [];
                        for (var i = 0; i < data.length; i++) {
                            _d.push(data[i]['teacher_id']);
                        }
                        storage.setItem(exist_person_id_array, JSON.stringify(_d));
                        // write parameters when calling the control was selected staff
                        storage.setItem("rule_course_id", obj.data.id);
                        // 2, call the personnel selector
                        WeAdminShow ( 'select a teacher', '../tea/PersonSelector.html?id=' + obj.data.id, 540, 520);
                    }
                });
            }*/

 A column in a table display method of the tips

// //注册提示
                    // $('#idTest').next().find('.layui-table-body').find("table").find("tbody").children("tr").poshytip(
                    //     {
                    //         className: 'tip-darkgray',
                    //         content: function (updateCallback) {
                    //             var id = JSON.stringify($('#idTest').next().find('.layui-table-body').find("table").find("tbody").find(".layui-table-hover").data('index'));
                    //             var data = res.data[id];
                    //             var content = "<font color='red'>我是测试</font><div id='test13'></div>";
                    //             return content.substring(0, content.length - 1);
                    //         },
                    //         showOn: 'hover',
                    //         alignY: 'bottom',
                    //         showTimeout: 50,
                    //     }
                    // );

 

Guess you like

Origin www.cnblogs.com/littlehb/p/11669480.html
Recommended