How to retrieve row data

How to retrieve row data

bacloud14bacloud14 Posts: 16Questions: 3Answers: 0

Hi there!
please would you tell me if there a way to retrieve row data in a very particular situation which is the following:
the row contains text input fields like the following example: https://datatables.net/examples/api/form.html , and the event of capturing is only when some field of the row is active (the cursor is pointing to), and the enter key is pressed.
so the event of data retrieval is not when the submit button is clicked like in the example, but when the field is active and the enter key is pressed.
Thank's alot.

Answers

  • bacloud14bacloud14 Posts: 16Questions: 3Answers: 0

    by the way, if you already used phpmyadmin, this exact feature is implemented when you want to modify on some field after running a SELECT operation.

  • tangerinetangerine Posts: 3,350Questions: 37Answers: 394

    Your second post refers tp phpMyAdmin enabling inline editing, which is also what the example from your first post is doing.

    However, your description in your first post is not the "exact feature" implemented by phpMyAdmin.

    In other words, please be more clear as to what you are asking. Do you want inline editing or not?

  • bacloud14bacloud14 Posts: 16Questions: 3Answers: 0

    OK tangerine, you are right, So yeah, I want inline editing, but the event is when enter key is pressed:
    $(document).keypress(function(e) {
    if(e.which == 13) {

                             var data = table.$('input, select').serialize();
                             alert(
                                 "The following data would have been submitted to the server: \n\n"+data.substr( 0, 100 )+'...'
                             );
                             return false;
                         }
                     });
    

    but in my case, I only want data of the row containing an active input.
    Thank you.

  • bacloud14bacloud14 Posts: 16Questions: 3Answers: 0

    Wow it's just now that I discovered that inline editing is possible and so easily customizable like the example here: https://editor.datatables.net/examples/inline-editing/simple
    So thank you datatables team!

This discussion has been closed.