简体   繁体   English

如何在GROCERY CRUD中制作多行字段?

[英]How make multiline fields in GROCERY CRUD?

What do I need to change to make two lines (or more) fields presentation in GROCERY CRUD (CodeIgniter framewoks)? 要在GROCERY CRUD(CodeIgniter framewoks)中显示两行(或更多)字段,我需要更改什么?

In examples on site I see table like I need. 网站上的示例中,我看到了所需的表格。 But I make view and see my table like this example 但是我像这个例子那样查看并查看我的表

I have some columns 50-100 characters long, and I need to show all content of them. 我有一些50-100个字符长的列,我需要显示它们的所有内容。 But now I getting something like My field cont... instead of: 但是现在我得到了类似“ My field cont...而不是:

'My field 
content'

If you are using GC version 1.3+, you can change grocery_crud_character_limiter config option to zero: 如果您使用的是1.3版或更高版本的GC,则可以将grocery_crud_character_limiter配置选项更改为零:

//The character limiter at the list page, zero(0) value if you don't want character limiter at your list page
$config['grocery_crud_character_limiter']   = 30;

in this file: 在此文件中:

application/config/grocery_crud.php 应用/配置/ grocery_crud.php

This is system-wide setting. 这是系统范围的设置。 If you want to affect only some lists, you will have to add some code: 如果只想影响某些列表,则必须添加一些代码:

$crud->callback_column('text_to_show', array($this, '_full_text'));

function _full_text($value, $row)
{
    return $value = wordwrap($row->text_to_show, 100, "<br>", true);
}

Credits goes to this page: http://www.grocerycrud.com/forums/topic/339-list-showing-data-row-without-limitation-of-chars/ 鸣谢到此页面: http : //www.grocerycrud.com/forums/topic/339-list-showing-data-row-without-limitation-of-chars/

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM