Changeset 7212
- Timestamp:
- 01/29/08 16:51:38 (10 months ago)
- Files:
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
plugins/sfExtjsThemePlugin/lib/helper/ExtjsHelper.php
r7018 r7212 35 35 } 36 36 37 // TODO: check http://extjs.com/forum/showthread.php?t=9171&highlight=overwrite+css38 // it is about autocompletion, might contain something usefull about being able to enter new values (not only the ones that are already in the foreign-store)39 37 function extjs_form_combobox($options) 40 38 { 41 39 $defaultOptions = array('displayField' => 'REQUIRED', 42 'queryParam' => 'filters[REQUIRED]', 43 'pageSize' => 20, 40 'triggerAction' => 'all', 44 41 'typeAhead' => true, 45 42 'minChars' => 2, 46 43 'mode' => 'remote', 44 'pageSize' => 15, 47 45 'lazyRender' => true, 48 'triggerAction' => 'all', 49 'listClass' => 'x-combo-list-small' 50 // 'plugins' => 'new Ext.ux.ComboBoxHandler()' 51 ); 46 'queryParam' => 'filters[REQUIRED]', 47 'listClass' => 'x-combo-list-small'); 52 48 53 49 $options = array_merge($defaultOptions, $options); 54 50 55 return _extjs_write_class(' ux.ComboBoxAutoLoad', array($options), true);51 return _extjs_write_class('form.ComboBox', array($options), true); 56 52 } 57 53 … … 81 77 //TODO: CHECK TYPES, apparantly integer does not exists but is int already... are they maybe switched? 82 78 //I now return $type, if not found. 83 if ( in_array($type, array('date', 'datetime', 'time', 'timestamp')))79 if ($type == 'date' || $type == 'time' || $type == 'timestamp') 84 80 { 85 81 return 'date'; … … 91 87 } 92 88 93 if ( in_array($type, array('float', 'double')))89 if (($type === 'float') || ($type === 'double')) 94 90 { 95 91 return 'float'; 96 92 } 97 93 98 if ($type == 'integer')94 if ($type === 'integer') 99 95 { 100 96 return 'int'; … … 214 210 return null; 215 211 } 212 213 function extjs_escape_json_string($string) 214 { 215 $escape = array("\r\n" => '\n', "\r" => '\n', "\n" => '\n', '"' => '\"', "'" => "\\'"); 216 return str_replace(array_keys($escape), array_values($escape), $string); 217 } 216 218 ?>