【问题标题】:jqgrid with textbox each rowjqgrid 每行带有文本框
【发布时间】:2012-08-09 23:09:43
【问题描述】:

是否可以让 jqgrid 每行都有一个文本框,然后可以将其拉入导出 excel 中?我正在使用 PHP Jqgrid

这是我的代码,我想为每一行添加一个文本框,就像一个注释。所以我可以在之后将其拉到报告中:

// Set grid caption using the option caption
$grid->setGridOptions(array(
    "caption"=>"Offer Report",
    "sortname"=>"offer_date",
    "hoverrows"=>true,
        "autowidth"=>true,
        "shrinkToFit"=>true,
        "height"=>"100%",
        "toppager"=>true,
    ));
// Change some property of the field(s)

$grid->setColProperty("unit_num", array("label"=>"Unit Number"));
$grid->setColProperty("unit_type", array("label"=>"Unit Type"));
$grid->setColProperty("sqft", array("label"=>"Size"));
$grid->setColProperty("offer_date", array("label"=>"Date", "align"=>"center","sorttype"=>"date", "formatter"=>"date","formatoptions"=>array("newformat"=>"m/d/Y")));
$grid->setColProperty("name", array("label"=>"Agent"));


$grid->setColProperty("list_price", array("label"=>"List Price", "align"=>"right"));

$grid->setColProperty("client", array("label"=>"Client"));


$grid->setColProperty("offer_price", array("label"=>"Offer", "align"=>"right"));


$grid->setColProperty("offer_credit", array("label"=>"Credits", "align"=>"right"));

$grid->setColProperty("broker_name", array("label"=>"Broker"));
$grid->setColProperty("broker_commission", array("label"=>"Commission", "align"=>"right"));


$grid->setColProperty("sf", array("label"=>"$/SF", "align"=>"right"));


$grid->setColProperty("discount", array("label"=>"Discount", "align"=>"right"));

$grid->setColProperty("offer_type", array("label"=>"Offer Type"));
$grid->setColProperty("status", array("label"=>"Status"));

// Enable Inline Filtering
$grid->toolbarfilter = true;

// Enable navigator
$grid->navigator = true;

// Enable excel export
$grid->setNavOptions('navigator', array("excel"=>true,"pdf"=>true,"add"=>false,"edit"=>false,"del"=>false,"view"=>false)); 
$grid->exportfile ='offer_report.xls';
$grid->pdffile ='offer_report.pdf';
// Enjoy
$grid->renderGrid('#grid','#grid_toppager',true, null, null, true,true);
$conn = null;

【问题讨论】:

    标签: php jquery jqgrid


    【解决方案1】:

    我从未使用过 php JqGrid,但您可以做一件事,在您的 loadComplete 或 GridComplete 函数中,您可以指定自定义文本框的代码。

    看看我之前的帖子,我告诉这个人如何在每一行附加一个自定义按钮,你可以在这里使用相同的方法,然后提取数据进行导出不会很困难。

    Adding a custom button in row in jqGrid?

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2011-03-16
      • 2011-04-26
      • 2016-05-29
      • 2015-09-08
      • 2014-02-20
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多