设置在kendogrid迷你线

时间:2013-07-22 21:45:40

标签: kendo-ui kendo-grid sparklines

我将在“使用”栏中使用迷你图,就像两个迷你图表相互覆盖一样

有一个问题,因为当我点击按钮时,Edite“sparkline”消失了。 或者点击“使用栏”认为发生了这种情况。

为什么工具提示不如显示工具提示不常规。

为什么在所有行中使用“使用列”,只有一行

jsfiddle code

$(document).ready(function () {

//var ds = new kendo.data.DataSource({

//    transport: {

//        read: {

//            url: '/api/clientssnapshot',
//            dataType: 'json',
//            type: 'get',
//            cache: false

//        },

//    },
//    batch: true,
//    pageSize: 10,
//    schema: {
//        model: {
//            fields: {
//                Mac: { editable: false, nullable: true },
//                RadioName: { type: "string", validation: { required: true } },
//                ApName: { type: "string", validation: { required: true, min: 1 } },
//                RemoteIp: { type: "boolean" },
//                TX: { type: "number", validation: { min: 0, required: true } },
//                RX: { type: "number", validation: { min: 0, required: true } },
//                Signal: { type: "number", validation: { min: 0, required: true } },
//                Uptime: { type: "number", validation: { min: 0, required: true } },
//            }
//        }
//    }

//});

$('.table').kendoGrid({

    dataSource: {
        data: [{
            "Mac": "D4:CA:6D:28:D1:05",
                "RadioName": "D4CA6D28D105",
                "ApName": "Om11",
                "ApIp": "10.20.0.100",
                "TX": 48,
                "RX": 54,
                "Signal": -64,
                "Uptime": 797452,
                "InRate": 0,
                "OutRate": 0,
                "AccountingId": 759,
                "AccountingName": "فرشاد صفایی زاده",
                "RemoteIp": "188.121.123.56",
                "IsValidInScan": true,
                "Comments": null,
                "ApScanId": 26173,
                "InRateHistory": "0, 0, 0, 0, 2, 0, 2, 16, 96, 16, 96, 16, 96, 113, 31, 113, 31, 113, 31, 0",
                "OutRateHistory": "0, 5, 3, 5, 2, 5, 2, 35, 136, 35, 136, 35, 136, 164, 51, 164, 51, 164, 51, 4"
        }, {
            "Mac": "00:15:6D:BD:64:92",
                "RadioName": "Behrooz Hoseyn",
                "ApName": "Om11",
                "ApIp": "10.20.0.100",
                "TX": 48,
                "RX": 18,
                "Signal": -65,
                "Uptime": 797446,
                "InRate": 2,
                "OutRate": 2,
                "AccountingId": 750,
                "AccountingName": "بهروز حسینی",
                "RemoteIp": "188.121.123.48",
                "IsValidInScan": true,
                "Comments": null,
                "ApScanId": 26173,
                "InRateHistory": "0, 0, 0, 0, 2, 0, 2, 16, 96, 16, 96, 16, 96, 113, 31, 113, 31, 113, 31, 0",
                "OutRateHistory": "0, 5, 3, 5, 2, 5, 2, 35, 136, 35, 136, 35, 136, 164, 51, 164, 51, 164, 51, 4"
        }, {
            "Mac": "00:15:6D:1E:B3:6C",
                "RadioName": "UBNT",
                "ApName": "Om11",
                "ApIp": "10.20.0.100",
                "TX": 54,
                "RX": 24,
                "Signal": -65,
                "Uptime": 310336,
                "InRate": 0,
                "OutRate": 0,
                "AccountingId": 820,
                "AccountingName": "******",
                "RemoteIp": "10.10.15.129",
                "IsValidInScan": true,
                "Comments": null,
                "ApScanId": 26173,
                "InRateHistory": "0, 0, 0, 0, 2, 0, 2, 16, 96, 16, 96, 16, 96, 113, 31, 113, 31, 113, 31, 0",
                "OutRateHistory": "0, 5, 3, 5, 2, 5, 2, 35, 136, 35, 136, 35, 136, 164, 51, 164, 51, 164, 51, 4"
        }, {
            "Mac": "00:15:6D:1C:B1:89",
                "RadioName": "Grous Tajhiz P",
                "ApName": "Om11",
                "ApIp": "10.20.0.100",
                "TX": 48,
                "RX": 6,
                "Signal": -62,
                "Uptime": 122116,
                "InRate": 0,
                "OutRate": 0,
                "AccountingId": 595,
                "AccountingName": "حمید شمس لواسانی",
                "RemoteIp": "188.121.124.17",
                "IsValidInScan": true,
                "Comments": null,
                "ApScanId": 26173,
                "InRateHistory": "0, 0, 0, 0, 2, 0, 2, 16, 96, 16, 96, 16, 96, 113, 31, 113, 31, 113, 31, 0",
                "OutRateHistory": "0, 5, 3, 5, 2, 5, 2, 35, 136, 35, 136, 35, 136, 164, 51, 164, 51, 164, 51, 4"
        }, {
            "Mac": "00:27:22:3E:91:12",
                "RadioName": "Anbar Aminzade",
                "ApName": "Om1",
                "ApIp": "10.20.0.101",
                "TX": 36,
                "RX": 36,
                "Signal": -68,
                "Uptime": 1131461,
                "InRate": 4,
                "OutRate": 4,
                "AccountingId": 977,
                "AccountingName": "انبار شهید امین زاده ",
                "RemoteIp": "188.121.123.31",
                "IsValidInScan": true,
                "Comments": null,
                "ApScanId": 26173,
                "InRateHistory": "0, 0, 0, 0, 2, 0, 2, 16, 96, 16, 96, 16, 96, 113, 31, 113, 31, 113, 31, 0",
                "OutRateHistory": "0, 5, 3, 5, 2, 5, 2, 35, 136, 35, 136, 35, 136, 164, 51, 164, 51, 164, 51, 4"
        }, {
            "Mac": "00:15:6D:1A:59:D0",
                "RadioName": "UBNT",
                "ApName": "Om1",
                "ApIp": "10.20.0.101",
                "TX": 36,
                "RX": 12,
                "Signal": -73,
                "Uptime": 734737,
                "InRate": 2,
                "OutRate": 2,
                "AccountingId": 820,
                "AccountingName": "******",
                "RemoteIp": "10.10.15.76",
                "IsValidInScan": true,
                "Comments": null,
                "ApScanId": 26173,
                "InRateHistory": "0, 0, 0, 0, 2, 0, 2, 16, 96, 16, 96, 16, 96, 113, 31, 113, 31, 113, 31, 0",
                "OutRateHistory": "0, 5, 3, 5, 2, 5, 2, 35, 136, 35, 136, 35, 136, 164, 51, 164, 51, 164, 51, 4"
        }, {
            "Mac": "00:15:6D:E2:2D:13",
                "RadioName": "UBNT",
                "ApName": "Om1",
                "ApIp": "10.20.0.101",
                "TX": 54,
                "RX": 36,
                "Signal": -72,
                "Uptime": 848,
                "InRate": 0,
                "OutRate": 0,
                "AccountingId": 820,
                "AccountingName": "******",
                "RemoteIp": "10.10.15.67",
                "IsValidInScan": true,
                "Comments": null,
                "ApScanId": 26173,
                "InRateHistory": "0, 0, 0, 0, 2, 0, 2, 16, 96, 16, 96, 16, 96, 113, 31, 113, 31, 113, 31, 0",
                "OutRateHistory": "0, 5, 3, 5, 2, 5, 2, 35, 136, 35, 136, 35, 136, 164, 51, 164, 51, 164, 51, 4"
        }, {
            "Mac": "00:27:22:32:24:C9",
                "RadioName": "UBNT",
                "ApName": "Om7",
                "ApIp": "10.20.0.100",
                "TX": 36,
                "RX": 24,
                "Signal": -78,
                "Uptime": 731588,
                "InRate": 0,
                "OutRate": 0,
                "AccountingId": 820,
                "AccountingName": "******",
                "RemoteIp": "10.10.15.188",
                "IsValidInScan": true,
                "Comments": null,
                "ApScanId": 26173,
                "InRateHistory": "0, 0, 0, 0, 2, 0, 2, 16, 96, 16, 96, 16, 96, 113, 31, 113, 31, 113, 31, 0",
                "OutRateHistory": "0, 5, 3, 5, 2, 5, 2, 35, 136, 35, 136, 35, 136, 164, 51, 164, 51, 164, 51, 4"
        }, {
            "Mac": "00:15:6D:FE:BB:E2",
                "RadioName": "ketabforooshie",
                "ApName": "Om7",
                "ApIp": "10.20.0.100",
                "TX": 54,
                "RX": 36,
                "Signal": -72,
                "Uptime": 240361,
                "InRate": 0,
                "OutRate": 0,
                "AccountingId": 533,
                "AccountingName": "قاسم رضاپور",
                "RemoteIp": "188.121.124.214",
                "IsValidInScan": true,
                "Comments": null,
                "ApScanId": 26173,
                "InRateHistory": "0, 0, 0, 0, 2, 0, 2, 16, 96, 16, 96, 16, 96, 113, 31, 113, 31, 113, 31, 0",
                "OutRateHistory": "0, 5, 3, 5, 2, 5, 2, 35, 136, 35, 136, 35, 136, 164, 51, 164, 51, 164, 51, 4"
        }, {
            "Mac": "00:27:22:D2:86:56",
                "RadioName": "UBNT",
                "ApName": "Om7",
                "ApIp": "10.20.0.100",
                "TX": 48,
                "RX": 12,
                "Signal": -72,
                "Uptime": 126430,
                "InRate": 0,
                "OutRate": 0,
                "AccountingId": 1453,
                "AccountingName": "حسن قربانی",
                "RemoteIp": "188.121.123.154",
                "IsValidInScan": true,
                "Comments": null,
                "ApScanId": 26173,
                "InRateHistory": "0, 0, 0, 0, 2, 0, 2, 16, 96, 16, 96, 16, 96, 113, 31, 113, 31, 113, 31, 0",
                "OutRateHistory": "0, 5, 3, 5, 2, 5, 2, 35, 136, 35, 136, 35, 136, 164, 51, 164, 51, 164, 51, 4"
        }, {
            "Mac": "00:27:22:78:A3:19",
                "RadioName": "UBNT",
                "ApName": "Om7",
                "ApIp": "10.20.0.100",
                "TX": 54,
                "RX": 54,
                "Signal": -56,
                "Uptime": 58617,
                "InRate": 0,
                "OutRate": 0,
                "AccountingId": 820,
                "AccountingName": "******",
                "RemoteIp": "10.10.15.39",
                "IsValidInScan": true,
                "Comments": null,
                "ApScanId": 26173,
                "InRateHistory": "0, 0, 0, 0, 2, 0, 2, 16, 96, 16, 96, 16, 96, 113, 31, 113, 31, 113, 31, 0",
                "OutRateHistory": "0, 5, 3, 5, 2, 5, 2, 35, 136, 35, 136, 35, 136, 164, 51, 164, 51, 164, 51, 4"
        }

        ]

    },
    sortable: true,
    groupable: true,
    selectable: true,
    navigatable: true,
    height: 500,
    scrollable: true,
    pageable: true,

    columns: [{
        field: "Mac",
        title: "Mac",
        width: 170
    }, {
        field: "RadioName",
        title: "Radio",
        width: 150
    }, {
        field: "ApName",
        title: "Ap",
        width: 80,
        template: '<a href="http://#= ApIp #" target="_blank">#=ApName#</a>'
    }, {
        field: "RemoteIp",
        title: "Remote IP",
        width: 160,
        template: '<a href="http://#= RemoteIp #" target="_blank">#=RemoteIp#</a>'
    }, {
        field: "AccountingName",
        title: "Name",
        width: 130,
        template: '<a href="#= AccountingId #" target="_blank"> #= AccountingName # </a>'
    }, {
        field: "TX",
        title: "TX",
        width: 44
    }, {
        field: "RX",
        title: "RX",
        width: 50
    }, {
        field: "Signal",
        title: "Signal",
        width: 50
    }, {
        field: "Uptime",
        title: "Uptime",
        width: 78
    }, {
        field: "Usage",
        title: "Usage",
        template: '<span id="sparkline"></span>'
    }, {
        command: ["edit"],
        title: "&nbsp;"
    }],
    editable: "popup",

});
$(".ref").click(function () {

    $(".table").data("kendoGrid").dataSource.read();

});
$("#sparkline").kendoSparkline({
            type: "area",

            series: [{
                name: "World",
                data: [15.7, 16.7, 20, 23.5, 26.6, 24.8, 24.1, 20.1, 14.1, 8.6, 2.5, 3.5],

            }, {
                name: 'New York',
                data: [0.7, 0.8, 5.7, 11.3, 17.0, 22.0, 24.8, 24.1, 20.1, 14.1, 8.6, 2.5],


            }],

            categoryAxis: {
               categories: [2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015]
            }

        });




<div class="span6 box gradient main_stting">
<div class="dataTables_filter" id="txtSearch">
    <label>Search:
        <input type="text" aria-controls="DataTables_Table_0">
    </label>
</div>
<div class="title">
    <button class="btn ref" type="submit">Refresh</button>
     <h3></h3>

</div>
<div class="content">
    <div class="table"></div>
</div>

谢谢

1 个答案:

答案 0 :(得分:0)

编辑后,HTML网格会在网格更新时被销毁并重新创建。您需要重新创建迷你图。它与this issue基本相同。