Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/478.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript 绑定具有大数据源(json数组)的kendogrid,需要任何动态特性_Javascript_Grid_Kendo Ui_Bind - Fatal编程技术网

Javascript 绑定具有大数据源(json数组)的kendogrid,需要任何动态特性

Javascript 绑定具有大数据源(json数组)的kendogrid,需要任何动态特性,javascript,grid,kendo-ui,bind,Javascript,Grid,Kendo Ui,Bind,我想绑定一个带有大数据源(json数组)的kendogrid,它也包括在3-4个选项卡中显示细节模板。但它不显示网格。(对于1500行)是否可以逐页显示任何动态内容?解决方案不需要搜索条件 请告知 感谢Yogesh函数bindgridsimple() function bindgridsimple() { var element = $("#grid").kendoGrid({ dataSource: { transport: { read: url

我想绑定一个带有大数据源(json数组)的kendogrid,它也包括在3-4个选项卡中显示细节模板。但它不显示网格。(对于1500行)是否可以逐页显示任何动态内容?解决方案不需要搜索条件

请告知

感谢Yogesh

函数bindgridsimple()
 function bindgridsimple() 
 {
    var element = $("#grid").kendoGrid({
    dataSource: {
    transport: {
    read: url
    },
    pageSize: 25
    },
    columnMenu: true,
    scrollable: true,
    filterable: true,
    resizable: true,
    sortable: true,
    detailTemplate: kendo.template($("#template").html()),
    detailInit: detailInit,
    dataBound: function () {                
    },
    columns: [
    {
    field: "FirstName",
    width: "8%",
    title: "Candidate Name",
    template: "<a  href='Candidates/candidaterequirementmapping.aspx?CandId=#=CandidateId#'> <span>#=FirstName#</span>&nbsp;<span>#=LastName#</span></a>" 
    },
    {
    field: "Mobile",
    width: "8%",
    title: "Mobile"
    },
    {
    field: "ResumeTitle",
    width: "10%",
    title: "Resume Title"
    },
    {
    field: "CreatedByUser",
    width: "10%",
    title: "Created by"
    },
    {
    field: "ExpectedSalary",
    width: "15%",
    title: "Expected Salary",
    template: "<span># if(ExpectedSalary == null) { # 0.00 # } else { #<span>#=ExpectedSalary#</span># }#</span>&nbsp;/&nbsp;<span>#=ExpectedSalaryperiod#</span>"
    },                    {
    field: "MarketingRate",
    width: "10%",
    title: "Mktg Rate",
    template: "<span># if(MarketingRate == null) { # 0.00 # } else { #<span>#=MarketingRate#</span># }#</span>&nbsp;/&nbsp;<span>#=MarketingRateperiod#</span>"
    },
    {
    field: "CreatedDate",
    width: "15%",
    title: "Resume Received Date",
    template: '#if(Resume == null || Resume == "") {  } else { # <span> #=parseFullDate(CreatedDate)# </span>  # } #'
    },
    {
    field: "ExistMappedCandidate",
    width: "10%",
    title: "Req. Provided"
    },
    {    
    field: "ExistMappedCandidate",
    width: "10%",
    title: "View",
    template: "# if(ExistMappedCandidate==true){ #<a href='Candidates/candidaterequirementmapping.aspx?CandId=#=CandidateId#'>View Requirement</a> #} else {# <a href='Candidates/candidaterequirementmapping.aspx?CandId=#=CandidateId#' class='No-candidates' onclick='return false' title='No requirements are mapped with this candidate.'>View Requirement</a> #}#"
    }
    ],
    pageable: {
    pageSizes: [25, 50, 75]
    }
    });
    }

   function detailInit(e) {
     var sharableDataSource = new kendo.data.DataSource({ data: e.data.Experience });
     var sharableDataSourceAttachment = new kendo.data.DataSource({ data: e.data.Attachments });

     var detailRow = e.detailRow;
     detailRow.find(".tabstrip").kendoTabStrip({
     animation: {
     open: { effects: "fadeIn" }
     }
     });

     detailRow.find(".prevExperience").kendoGrid({
            dataSource: { data: e.data.Experience,
                pageSize: 10
            },
            columnMenu: true,
            scrollable: true,
            filterable: true,
            resizable: false,
            sortable: true,
            pageable: {
                pageSizes: [10, 20]
            },
            columns: [
                        { field: "Company", title: "Company Name", width: "100px" },
                        { field: "Designation", title: "Designation", width: "100px" },
                        { field: "FromDate", title: "From", width: "100px", template: '#=parsemyDate(FromDate)#' },
                        { field: "ToDate", title: "To", width: "100px", template: '#=parsemyDate(ToDate)#' },
                        { field: "LastSalary", title: "Last CTC", width: "65px", template: '#=LastSalary# / Yr' }
                    ]
        });

        detailRow.find(".attachments").kendoGrid({
            //dataSource: sharableDataSourceAttachment,
            dataSource: { data: e.data.Attachments,
                pageSize: 10
            },
            columnMenu:true,
            scrollable: false,
            sortable: true, 
            filterable: true,        
            pageable: {
                pageSizes: [10, 20]
            },
            columns: [
                        { field: "AttachmentName", sortable: true, filterable: true, title: "File Icon", width: "100px", template: '<a href="Attachments/#=AttachmentName#">#= AttachmentTitle #</a>'
                        },
            //                        { field: "AttachmentTitle", title: "Type", width: "100px" },
            //                        { field: "AttachmentName", title: "Subject", width: "100px", template: 'Resume' },
                        {field: "CreatedbyUser", sortable: true, filterable: true, title: "Attached By", width: "100px" },
                        { field: "Createddate", title: "Date", sortable: true, filterable: true, width: "65px", template: '#=parseFullDate(Createddate)#' }
                    ]
        });
    }
{ var元素=$(“#网格”).kendoGrid({ 数据源:{ 运输:{ 阅读:url }, 页面大小:25 }, 专栏菜单:是的, 可滚动:对, 可过滤:正确, 可调整大小:正确, 可排序:是的, detailTemplate:kendo.template($(“#template”).html()), detailInit:detailInit, 数据绑定:函数(){ }, 栏目:[ { 字段:“名字”, 宽度:“8%”, 标题:“候选人姓名”, 模板:“” }, { 字段:“移动”, 宽度:“8%”, 标题:“手机” }, { 字段:“简历标题”, 宽度:“10%”, 标题:“简历标题” }, { 字段:“CreatedByUser”, 宽度:“10%”, 标题:“创建人” }, { 字段:“期望薪资”, 宽度:“15%”, 标题:“期望工资”, 模板:“#if(ExpectedSalary==null){#0.00#}else{###=ExpectedSalary##}#/#=ExpectedSalaryperiod#” }, { 字段:“市场化率”, 宽度:“10%”, 标题:“Mktg费率”, 模板:“#if(MarketingRate==null){#0.00#}else{####=MarketingRate#}#/#=MarketingRate period#” }, { 字段:“CreatedDate”, 宽度:“15%”, 标题:“简历收到日期”, 模板:“#if(Resume==null | | Resume==”){}else{##=parseFullDate(CreatedDate)##}” }, { 字段:“ExistMappedCandidate”, 宽度:“10%”, 标题:“要求提供” }, { 字段:“ExistMappedCandidate”, 宽度:“10%”, 标题:“视图”, 模板:“#如果(ExistMappedCandidate==true){##}其他{##}” } ], 可分页:{ 页面大小:[25、50、75] } }); } 函数detailInit(e){ var sharableDataSource=new kendo.data.DataSource({data:e.data.Experience}); var sharableDataSourceAttachment=new kendo.data.DataSource({data:e.data.Attachments}); var detailRow=e.detailRow; detailRow.find(“.tabstrip”).kendoTabStrip({ 动画:{ 打开:{效果:“fadeIn”} } }); detailRow.find(“.prevExperience”).kendoGrid({ 数据源:{data:e.data.Experience, 页面大小:10 }, 专栏菜单:是的, 可滚动:对, 可过滤:正确, 可调整大小:false, 可排序:是的, 可分页:{ 页面大小:[10,20] }, 栏目:[ {字段:“公司”,标题:“公司名称”,宽度:“100px”}, {字段:“指定”,标题:“指定”,宽度:“100px”}, {字段:“FromDate”,标题:“From”,宽度:“100px”,模板:'#=parsemyDate(FromDate)#', {字段:“ToDate”,标题:“To”,宽度:“100px”,模板:'#=parsemyDate(ToDate)#', {字段:“LastSalary”,标题:“Last CTC”,宽度:“65px”,模板:'#=LastSalary#/Yr'} ] }); detailRow.find(“.attachments”).kendoGrid({ //数据源:sharableDataSourceAttachment, 数据源:{data:e.data.Attachments, 页面大小:10 }, 专栏菜单:是的, 可滚动:false, 可排序:是的, 可过滤:正确, 可分页:{ 页面大小:[10,20] }, 栏目:[ {字段:“AttachmentName”,可排序:true,可筛选:true,标题:“文件图标”,宽度:“100px”,模板:“” }, //{字段:“AttachmentTitle”,标题:“Type”,宽度:“100px”}, //{字段:“AttachmentName”,标题:“主题”,宽度:“100px”,模板:“Resume”}, {字段:“CreatedbyUser”,可排序:true,可筛选:true,标题:“附件”,宽度:“100px”}, {字段:“Createddate”,标题:“Date”,可排序:true,可筛选:true,宽度:“65px”,模板:'#=parseFullDate(Createddate)#'} ] }); }
您是否尝试过网格中的pageable和数据源中的pageSize?您的服务器是否能够一次提供一个页面?嗨,OnaBai,是的,我尝试了页面大小和页面可分页性,但没有输出。您应该共享一些代码,否则很难猜测我为绑定网格而编写的代码如下: