参考连接:Enum filter with numeric values

修改Fields\Enum::build()方法

$options['options'][] = array(
				'id' => is_numeric($val) && (!array_key_exists('enum_numeric_keys', $options) || $options['enum_numeric_keys'] == false) ? $text : $val,
				'text' => $text,
			);

使用时,添加一个'enum_numeric_keys'=>true,

/**
   * The editable fields
   */
  'edit_fields' => array(

    'type' => array(
    	'enum_numeric_keys'=>true,
      	'title' => 'test',
      	'type'  => 'enum',

	  	'options' => array(
  			'1' => 'text1',
  			'2' => 'text2',
  			'3' => 'text3',
  			'4' => 'text4'
  		),
    )
  ),

相关文章:

  • 2022-12-23
  • 2021-10-06
  • 2021-12-20
  • 2022-12-23
  • 2022-02-04
  • 2022-02-04
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2021-09-13
  • 2021-07-31
  • 2022-12-23
  • 2022-12-23
  • 2022-03-01
  • 2021-10-05
  • 2022-12-23
相关资源
相似解决方案