gijgo icon indicating copy to clipboard operation
gijgo copied to clipboard

Edit with dropdown set Field to a null value

Open Aragorn2004 opened this issue 5 years ago • 0 comments

Hi, using 1.9.13 with bootstrap 3.37

issue / problem

  1. when i try change DIP_NAME: before click edit button i see value in the field (es. PACINO) when i click edit button value PACINO disappears but i can select values from dropdown and if push update button without selecting anything from dropdown the value in the field is set to NULL

  2. DIP_NAME is sortable and every click to sort produces duplication of icon of edit button. If i click 4 times on Sort i've 4 edit button

  3. Is it possible dinamically change value in a field in the row after user change value in a dropdown type field in the same row?

Any suggestions.

My Code is

var renderer = function (value, record, $cell, $displayEl, id) { var $editBtn = $(''); var $updateBtn = $('');

    $editBtn.on('click', function (e) {
        grid.edit($(this).data('key'));
        $editBtn.hide();
        $updateBtn.show();
    });

    $updateBtn.on('click', function (e) {
        grid.update($(this).data('key'));
        $editBtn.show();
        $updateBtn.hide();
    });
    $displayEl.append($editBtn).append($updateBtn);
    $updateBtn.hide();
};

grid = $('#grid').grid({ dataSource: foundrec, uiLibrary: 'bootstrap3', primaryKey: 'DIP_ID', inlineEditing: { mode: 'command', managementColumn: false }, columns: [ { field: 'DIP_ID', width: 94 }, { field: 'DIP_NAME', sortable: true, title: 'Nome', type: 'dropdown', editField: 'DIP_ID', editor: { dataSource: MyValues, valueField: 'DIP_ID' } }, { field: 'DAYS, width: 94, editor: true }, { width: 56, align: 'center', renderer: renderer } ], pager: { limit: 5 } });

Aragorn2004 avatar May 06 '20 14:05 Aragorn2004