Grid edit: better modification checking for relation field, when 'Relational display column' is chosen

This commit is contained in:
Aris Feryanto 2011-07-28 17:54:21 +08:00
parent d1c219b94e
commit 8d0138cfb6

View File

@ -655,6 +655,9 @@
//handle relations
$editArea.addClass('edit_area_loading');
// initialize the original data
$td.data('original_data', null);
/**
* @var post_params Object containing parameters for the POST request
*/
@ -672,6 +675,12 @@
$.post('sql.php', post_params, function(data) {
$editArea.removeClass('edit_area_loading');
// save original_data
var value = $(data.dropdown).val();
$td.data('original_data', value);
// update the text input field, in case where the "Relational display column" is checked
$(g.cEdit).find('input[type=text]').val(value);
$editArea.append(data.dropdown);
$editArea.append('<div class="cell_edit_hint">' + g.cellEditHint + '</div>');
}) // end $.post()