聯系官方銷售客服
1835022288
028-61286886
全局表單,在后臺讀取數據時,kssfzh 字段 如果在值最后統一加上空格?
mytable.html
// 按自定義字段顯示
{loop $list_field $i $tt}
field_columns.push({
// field: '{$i}',
field: '{if $i=="kssfzh"}kssfzh{else}{$i}{/if}',
title: '{dr_lang($tt.name)}',
align: '{if $tt.center}center{else}left{/if}',
switchable: true,
sortable: true,
{if $tt.width}width: '{$tt.width}px',{/if}
visible: true
});
{/list}
/App/Form/Control/Admin/Form.php
// 后臺查看表單列表
protected function _Admin_List() {
$this->is_ajax_list = true;
list($tpl) = $this->_List();
$this->mytable = [
'foot_tpl' => '',
'link_tpl' => '',
'link_var' => 'html = html.replace(/\{id\}/g, row.id);
html = html.replace(/\{cid\}/g, row.id);
html = html.replace(/\{fid\}/g, "'.\Phpcmf\Service::L('Router')->class.'");',
];
$uriprefix = APP_DIR.'/'.\Phpcmf\Service::L('Router')->class;
說結果集空格,你想的太復雜了,不需要改那么多文件
寫回調函數就可以了
參考文檔:《后臺顯示字段回調》