IT-KIMI_SHI\SINOIT.KIMI
2018-06-01 64c40fb427bff513f575f11e4c1e7bd9a1bfe3e3
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
(function ($) {
 
    Array.prototype.exists = function(prop, value) {
        if (!value) {
            value = prop;
            prop = null;
        }
        
        for (var i = 0; i < this.length; i++) {
            var line = this[i];
            line = this[i].record ? this[i].record : this[i];
            
            if (prop) {
                if (line[prop] == value) {
                    return true;
                }
            }
            else {
                if (line == value) {
                    return true;
                }
            }
        }
        
        return false;
    };
    
    Array.prototype.getItem = function(prop, value) {
        if (!value) {
            value = prop;
            prop = null;
        }
        
        for (var i = 0; i < this.length; i++) {
            var line = this[i];
            line = this[i].record ? this[i].record : this[i];
            
            if (prop) {
                if (line[prop] == value) {
                    return line;
                }
            }
            else {
                if (line == value) {
                    return line;
                }
            }
        }
        
        return null;
    };    
 
 
})(jQuery);