2012-08-09 34 views
0

是否有可能在每行有一個文本框的jqgrid,然後可以在導出excel中將其拉入?我正在使用PHP Jqgridjqgrid帶有文本框的每一行

這是我的代碼,我想爲每行添加一個文本框,就像一個筆記。所以我可以後拉到報告:

// 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; 

回答

1

我從來沒有使用PHP的jqGrid的,但你可以做一兩件事,在你loadComplete或GridComplete功能,你可以指定一個自定義文本框的代碼。

看看我以前的帖子,我告訴這個人關於如何在每行添加一個自定義按鈕,你可以在這裏使用的相同的方法,然後拉出數據導出並不困難。

Adding a custom button in row in jqGrid?