0
在phpgrid中,我使用add_column
方法添加了虛擬列(不存在於db中的列)。但問題是我不能讓它出現在第一個位置(即表格的第一列)。 add_column
方法的文檔說明它將被附加在其他列的末尾add_method for phpgrid。是否有可能將其添加到第一列/位置?我嘗試了各種jQuery的黑客,但似乎沒有用。更改虛擬列的位置phpgrid
下面是add_column
PHP代碼
$dg->add_column("custom", array('name' => 'custom',
'index' => 'custom',
'width' => '100',
'formatter' => '###customAction###',
'formatoptions' => array('keys' => true, 'editbutton' => true, 'delbutton' => true)), 'Custom Action');
代碼的JavaScript代碼
function customAction(cellValue, options, rowdata) {
output = '<span class="custom-action"><i class="glyphicon glyphicon-plus custom" data-transaction-id="' + options.rowId + '"></i></span>';
return output;
}
非常感謝。它的工作原理 –
歡迎您! – user3915432
列出現在第一個位置,但其他列中的數據混亂了,在表頭中,我可以看到列的標題,但無法看到表中的數據。 –