![](/img/trans.png)
[英]adding values of inputs in each row in corresponding textbox using jQuery
[英]jqgrid with textbox each row
是否可以讓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 JqGrid,但您可以做一件事,在您的loadComplete或GridComplete函數中,您可以為自定義文本框指定代碼。
看看我以前的帖子,我告訴這個家伙如何將自定義按鈕添加到每一行,您可以在此處使用相同的方法,然后提取數據進行導出就不會那么困難了。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.