paramQuery grid to pdf

时间:2014-09-06 14:54:14

标签: javascript

是否可以将paramQuery网格导出为pdf,或者我该怎么做?这就是我创建网格的方式,我想在pdf文件中显示这个网格

createGrid = function(){
    var obj = { 
        width:"100%",
        height : "100%" , 
        title : "grid" , 
        flexHeight : false ,
        resizable : false ,
        draggable : false , 
        scrollModel: {scrollTillLastRow:false, scrollTillLastColumn:true},
        numberCell : true, 
    } ;
    obj.colModel = [
        { 
            title : "Date" , 
            width : 200 , 
            dataType : "string" , 
            dataIndx : "Date" 
        } ,
        { 
            title : "Name" , 
            width : 200, dataType : "string" , 
            dataIndx : "Name"
        } 
    ] ;
    obj.dataModel = {
        data : lstData //this is the object with the information
    } ;
    obj.width = "460px";
    obj.height = "300px";
    var $grid = $ ( "#grid_json" ).pqGrid ( obj ) ;
}

1 个答案:

答案 0 :(得分:0)

{
            type: 'select',
            label: 'Format: ',
            attr: 'id="export_format" style= "padding: 5% 0"',
            options: [{
              xlsx: 'Excel',
              csv: 'Csv',
              htm: 'Html',
              json: 'Json',
              pdf: 'pdf'
            }]
          },

          {
            type: 'button',
            label: "Export",
            icon: 'ui-icon-arrowthickstop-1-s',
            listener: function () {

              var format = $("#export_format").val(),
                blob = this.exportData({                     
                  format: format,
                  render: true
                });
              if (typeof blob === "string") {
                blob = new Blob([blob]);
              }
              saveAs(blob, "Cost Modeler." + format);
            }
          }
  

您只需将此代码包含在工具栏项目