Inline edit fine-tuned for enum fields

This commit is contained in:
Madhura Jayaratne
2011-02-22 04:31:00 +05:30
parent 3d8300a70b
commit aa6fe093d6
2 changed files with 2 additions and 2 deletions

View File

@@ -476,7 +476,7 @@ $(document).ready(function() {
// if 'chechbox_null_<field_name>_<row_index>' is clicked empty the corresponding select/editor. // if 'chechbox_null_<field_name>_<row_index>' is clicked empty the corresponding select/editor.
$('.checkbox_null_' + field_name + '_' + this_row_index).bind('click', function(e) { $('.checkbox_null_' + field_name + '_' + this_row_index).bind('click', function(e) {
if ($this_field.is('.enum, .set')) { if ($this_field.is('.enum, .set')) {
$this_field.find('select').selectedIndex = -1; $this_field.find('select').attr('value', '');
} else if ($this_field.is('.relation')) { } else if ($this_field.is('.relation')) {
// if the dropdown is there to select the foreign value // if the dropdown is there to select the foreign value
if ($this_field.find('select').length > 0) { if ($this_field.find('select').length > 0) {

View File

@@ -100,7 +100,7 @@ if(isset($_REQUEST['get_enum_values']) && $_REQUEST['get_enum_values'] == true)
$values = explode(',', str_replace($search, '', $field_info_result[0]['Type'])); $values = explode(',', str_replace($search, '', $field_info_result[0]['Type']));
$dropdown = ''; $dropdown = '<option value="">&nbsp;</option>';
foreach($values as $value) { foreach($values as $value) {
$dropdown .= '<option value="' . htmlspecialchars($value) . '"'; $dropdown .= '<option value="' . htmlspecialchars($value) . '"';
if($value == $_REQUEST['curr_value']) { if($value == $_REQUEST['curr_value']) {