easyUI自定义列排序

sorter:function(a,b){
                        var pattenStr = new RegExp("s|-| |:|/","g");
                        a = a.split(pattenStr);
                        b = b.split(pattenStr);
                        alert(a);
                        if (a[0] == b[0]){
                            if (a[1] == b[1]){
                                if(a[2] == b[2]){
                                    if(a[3] == b[3]){
                                        if(a[4] == b[4]){
                                            return (a[5]>b[5]?1:-1);
                                        }else{
                                            return (a[4]>b[4]?1:-1);
                                        }
                                    }else{
                                        return (a[3]>b[3]?1:-1);
                                    }
                                }else{
                                    return (a[2]>b[2]?1:-1);
                                }
                            } else {
                                return (a[1]>b[1]?1:-1);
                            }
                        } else {
                            return (a[0]>b[0]?1:-1);
                        }
                    }    
原文地址:https://www.cnblogs.com/1025804158ysb/p/7573732.html