剑道网格扩展行无法正常工作

马克·穆尼·格里菲思

我有一个从SQL数据库填充的Kendo网格。程序首次启动时,kendo扩展工作正常,并在扩展中返回了一个不同的kendo网格,但是如果我进行新的搜索并返回不同的结果,则扩展行将不起作用。

我的扩展代码->

function detailInitd(e) {   

TextvalueFile  = "manno test";   

$.ajax({
    type: "post",
    data: JSON.stringify({
        search_string: TextvalueFile,
    }),
    url: "/Search.aspx/File_Search",
    dataType: "json",
    contentType: 'application/json',

    success: function (object) {
        response(object);
    },
    complete: function (object) {

    },
    error: function (object) {
    }
});
function response(object) {
    var grid = this;

    $("<div/>").appendTo(e.detailCell).kendoGrid({
        dataSource: {
            data: object.d,
            schema: {
                model: {

                    path: { type: "string" },
                    st_size: { type: "number" },

                },
            },
            pageSize: 20,
        },
        reorderable: true,
        resizable: true,
        navigatable: true,
        selectable: "multiple",
        scrollable: true,
        sortable: true,
        filterable: true,
        columnMenu: true,
        pageable: {
            input: true,
            numeric: true
        },

        columns: [

           { field: "path", title: "Path", width: 200 },
                { field: "st_size", title: "Size", width: 60 },
                 { field: "st_blks", title: "BLKS", width: 60 },
                  { field: "st_acctime", title: "acc Time", width: 70 },
                   { field: "st_modtime", title: "mod Time", width: 75 },

        ]

    });

}
};

我的原始剑道网格代码->

function DisplaySearch() {




}
textS.value = value;
    valsearch = textS;
    $.ajax({
        type: "post",
        data: JSON.stringify({
            search_string: valsearch,
        }),
        url: "/Search.aspx/display_search",
        dataType: "json",
        contentType: 'application/json',

        success: function (object) {
            response(object);
        },
        complete: function (object) {

        },
        error: function (object) {
        }
    });
    function response(object) {
        $("#searchGrid").kendoGrid({
            theme:"Default",
            dataSource: {
                data: object.d,
                schema: {
                    model: {
                        archive_header_key: { type: "number" },
                        group_Name: { type: "string" },
                        Server: { type: "string" },
                        archive: { type: "string" },
                        display_name: { type: "string" },
                        file_written: { type: "number" },
                        session_ID: { type: "string" },
                        create_browse: {type:"number"},
                    },
                },
                pageSize: 20,                   

            },
            detailInit: detailInit,
            dataBound: function () {
                this.expandRow(this.tbody.find("tr"));
            },
            reorderable: true,
            navigatable: true,
            selectable: "single",              
            scrollable: true,
            sortable: true,
            filterable: false,
            columnMenu: true,
            reordable: true,
            resizable: true,


            pageable: {
                input: true,
                numeric: true,


            },
        columns: [
            { field: "archive_header_key", title: "Key", width: 50 },
            { field: "Server", title: "Server", width: 75 },
            { field: "group_Name", title: "Group", width: 75 },
            { field: "archive", title: "Archive", width: 50 },
             { field: "display_name", title: "Display name", width: 300 },
            { field: "file_written", title: "Files", width: 50 },
             { field: "session_ID", title: "Session", width: 200 },
             {field: "create_browse", title:"Browse", Width: 50},
        ],
        change: function(){

            var grid = this;

            grid.select().each(function(){
                var dataItem = grid.dataItem($(this));
                testdata = dataItem.archive_header_key;
                grid.expandRow(grid.element.closest("tr"));              
            })
        },
        dataBound: function () {
            this.expandRow();
        },

        });


    }       

任何帮助,将不胜感激。

马尔诺斯纳

有一些示例代码可以检查kendoGrid是否已经初始化:https ://www.telerik.com/forums/grid-creation-best-practices

它对我有用,并修复了expandRow问题。

function searchButtonClick() {
    var gridElement = $("#grid"),
        grid = gridElement.data("kendoGrid");
    if (!grid) {
        gridElement.kendoGrid({
            ...
        });
    } else {
        grid.dataSource.read();
    }
}

本文收集自互联网,转载请注明来源。

如有侵权,请联系[email protected] 删除。

编辑于
0

我来说两句

0条评论
登录后参与评论

相关文章

来自分类Dev

Chrome扩展程序setTimeout无法正常工作

来自分类Dev

今天扩展无法正常工作

来自分类Dev

Codeigniter DB语言扩展无法正常工作

来自分类Dev

网格无法正常工作python Tkinter

来自分类Dev

剑道网格日期输入输出无法正常工作

来自分类Dev

引导网格列无法正常工作

来自分类Dev

Jasper报告:字体扩展无法正常工作

来自分类Dev

Foundation 12网格无法正常工作

来自分类Dev

网格模板列无法正常工作。在某些行中获取空白

来自分类Dev

无法编辑剑道网格

来自分类Dev

剑道网格-Read()无法正常工作

来自分类Dev

剑道网格行未显示

来自分类Dev

扩展jQuery无法正常工作...?

来自分类Dev

Mcrypt PHP扩展安装无法正常工作

来自分类Dev

今天扩展无法正常工作

来自分类Dev

剑道Dragdrop无法正常工作?

来自分类Dev

扩展ActiveRecord :: Base无法正常工作

来自分类Dev

Purecss网格无法正常工作

来自分类Dev

剑道编辑器在剑道标签条内无法正常工作

来自分类Dev

Bootstrap网格无法正常工作

来自分类Dev

在Scroll的Handsontable网格行上应用的CSS无法正常工作

来自分类Dev

Bootstrap网格列无法正常工作

来自分类Dev

与今天扩展共享SQLite无法正常工作

来自分类Dev

APOC扩展程序无法正常工作

来自分类Dev

Coffeescript树扩展类无法正常工作

来自分类Dev

Google Chome扩展-jQuery无法正常工作

来自分类Dev

Bootstrap 网格无法正常工作

来自分类Dev

显示网格在 Polymer 中无法正常工作

来自分类Dev

剑道网格表扩展删除表数据