• 在angular里写jQuery 操作bootstrap-table rows——angular经历


    onLoadSuccess: function (data) {
                                var _bool = mzServer.Msg.isSelectVal();
                                if (!angular.isUndefined(_bool)) {
                                    var cloum = _bool["cloums"];
                                    if (!angular.isUndefined(cloum)) {
                                        for (var i = 0; i < cloum.length; i++) {
                                            $(element).find('tbody tr td').each(function () {
                                                var keyval = $(this).find("input[type='checkbox'],input[type='radio']").attr("value");
                                                if (keyval == cloum[i]) {
                                                    $(this).parent("tr").addClass("selected");
                                                    $(this).find("input[type='checkbox'],input[type='radio']").attr("checked", true);
                                                }
                                            })
                                            for (var u = 0; u < data.rows.length; u++) {
                                                var keyid = attrs.idfield;
                                                if (data.rows[u][keyid] == cloum[i]) {
                                                    data.rows[u][0] = true;
                                                }
                                            }
                                        }
                                    }
    
                                }
                                //else {
                                //if (!angular.isUndefined(data.rows[0]))//默认第一项选中
                                //    {
                                //            data.rows[0][0]= true;
                                //            $(element).find('tbody>tr[data-index="0"]').addClass("selected");
                                //            $(element).find('tbody>tr>td>input[data-index="0"]').attr("checked", true);
                                //     }
                                //   }
                                tableHeight(element, data);
                            },
    
    
    function tableHeight(element, data) {
                     var _rowsT = data.rows.length;
                     var _hightT = $(element).height();
                     if (_rowsT < 15) {
                         $(element).closest(".fixed-table-container").height(_hightT-20);
                     } 
                 }

  • 相关阅读:
    第十六节 URL映射的时候指定默认参数
    第十五节 自定义path转换器
    第十四节 reverse函数补充
    第十一节 实例命名空间
    第十节 url命名和应用命名空间
    第八节 url解释器
    MySQL条件查询
    MySQL判断数据是否为空
    MySQL拼接字符串
    MySQL加号+ 的作用
  • 原文地址:https://www.cnblogs.com/dlgood/p/6203211.html
Copyright © 2020-2023  润新知