首页 > 初始化只加载一次的function,怎么样才能重复调用?

初始化只加载一次的function,怎么样才能重复调用?

$(document).ready(function () {

 $("#in-lib").kendoGrid({
        dataSource: dataSource,
        pageable: true,
        height: 500,
        columns: [
            { field: "id", title:"物料批次号", width: "100px"},
            { field: "urlPath", title:"采购日期", width: "80px" },
            { field: "imgType", title:"采购人", width: "80px" },
            { field: "imgSize", title:"物料名称", width: "80px" },
             { field: "kljsad",title:"供应商",width:"80px"},
             { field: "kljsad",title:"进货数量",width:"80px"},
             { field: "kljsad",title:"单位",width:"40px"},
             { field: "kljsad",title:"规格",width:"50px"},
             { field: "kljsad",title:"质检",width:"80px",template:"##"},
             { command:
              [
                {text:"入库",name:"inLib",click:buttonClickHandler}
              ],
                title:"操作",
                width:"80px"
             }
            ]
    });
    
    
    
      var fedp = $("#feed-tmpin");

      fedp.kendoWindow({
        title: "物料入库",
        modal: true,
        visible: false,
        width:"750px",
        height:"570px",
        actions: [
            "Pin",
            "Minimize",
            "Maximize",
            "Close"
        ]
        }).data("kendoWindow").center();


      function buttonClickHandler(e){
      fedp.data("kendoWindow").open();
      $("#feed-in").kendoGrid({
        dataSource: dataSource_in,
        pageable: true,
        width:"auto",
        height:500,
        columns: [
            { field: "urlPath", title:"物料编号", width: "50px" },
            { field: "imgType", title:"物料名称", width: "70px" },
            { field: "Category7", title: "需求数量", width: "40px"},
            { field: "h1", title:"入库数量", width: "50px"},
            { field: "h2", title:"单位", width: "30px"},
            { field: "h3", title:"规格", width: "50px"},
            { field: "h4", title:"入库", width: "50px"},
             { command: 
                [
                    {text:'编辑',name:'edit'}
                ], 
                    title: "操作", width: "70px" ,
              },

            ],
        editable: "inline"
    });
    }
    

});

下面这个buttonClickHandler的方法只执行了一次,怎么样可以重复执行呢?
每次点击inLib时触发buttonClickHandler?

{text:"入库",name:"inLib",click:buttonClickHandler}

 function buttonClickHandler(e){
  fedp.data("kendoWindow").open();
  $("#feed-in").kendoGrid({
    dataSource: dataSource_in,
    pageable: true,
    width:"auto",
    height:500,
    columns: [
        { field: "urlPath", title:"物料编号", width: "50px" },
        { field: "imgType", title:"物料名称", width: "70px" },
        { field: "Category7", title: "需求数量", width: "40px"},
        { field: "h1", title:"入库数量", width: "50px"},
        { field: "h2", title:"单位", width: "30px"},
        { field: "h3", title:"规格", width: "50px"},
        { field: "h4", title:"入库", width: "50px"},
         { command: 
            [
                {text:'编辑',name:'edit'}
            ], 
                title: "操作", width: "70px" ,
          },

        ],
    editable: "inline"
});
}

$("#in-lib").bind("click",buttonClickHandler);

追加在$(document).ready(function () {内部的buttonClickHandler函数后面

【热门文章】
【热门文章】