Inline edit and confirm

Inline edit and confirm

henry2021henry2021 Posts: 13Questions: 1Answers: 0

Hi, I've a question about inline editing. I've successfully implemented a page (razor) which includes a datatable grid. Clicking in a grid cell the editor is correctly opened and confirming the input with carriage return the input is sent via ajax for validation to the server. Do I have a chance to confirm input with a tab or simply clicking on another grid cell ? Thanks for your help.

This question has an accepted answers - jump to answer

Answers

  • colincolin Posts: 15,112Questions: 1Answers: 2,583

    You can also submit on blur - see example here - that would cover both the clicking away and tabbing out of the edited cell.

    Colin

  • henry2021henry2021 Posts: 13Questions: 1Answers: 0

    Hi Colin, thanks a lot for your reply. Following the suggested example I've tested with the onBlur function:

    $('#MyDatatable').on('click', 'tbody td:not(:first-child)', function (e) {
            editor.inline(this, {
                onBlur: 'submit'
            });
        });
    

    I was able to verify this behavior :
    1) if I insert a number in a cell and then I click outside the datatable rows it works fine
    2) if I insert a number in a cell and then I click in another cell inside the grid datatable the first value is updated correctly but the "Processing..." label is not closed. From here I cannot update other cells.
    3) With tabbing out the cell grid cannot be updated. Server validation is not called.

    Thanks again for your help.

  • colincolin Posts: 15,112Questions: 1Answers: 2,583

    That's not happening in the example I linked to, so it must be something you've added with your customisations. Could you post your code, please, or update this example to demonstrate the issue,

    Colin

  • henry2021henry2021 Posts: 13Questions: 1Answers: 0

    ok I will try to publish as soon as possible a simplified version of my code that let you investigate my use case scenario.

    Enrico.

  • henry2021henry2021 Posts: 13Questions: 1Answers: 0

    Hi Colin,
    I've just published a simple project that reproduces the issue I reported few days ago.

    You can check it at this link http://tfservice.sysemtech.com/

    From this example If you enter a digit in one of the green cell and then you click in another cell that is not colored it works as expected. Also with carriage return the value of the cell is correctly updated.

    If you enter a digit in one of the green cell and then you click in the other cell that has green color you can verify the issue I've reported.

    Thanks for your patience.

    Enrico.

  • allanallan Posts: 61,431Questions: 1Answers: 10,048 Site admin
    Answer ✓

    Hi Enrico,

    editor.inline(this, {

    Is the problem I believe. Since you are using server-side processing, you need to use:

    editor.inline( table.cell(this).index(), {
    

    See this example.

    Allan

  • henry2021henry2021 Posts: 13Questions: 1Answers: 0

    Ok, I will test with the new suggestion today, and I will report if this can resolve.

    Thanks.

  • henry2021henry2021 Posts: 13Questions: 1Answers: 0

    Thank you Allan. With this code the issue is resolved.

    editor.inline( table.cell(this).index(), { 
    
Sign In or Register to comment.