This topic contains 2 replies, has 2 voices, and was last updated by  mhykgyver 2 days, 22 hours ago.

m-datatable–on-check: retrieve elements and display on textboxes


  • mhykgyver
    Participant

    Posts: 23
    Member Reply #15054

    Hi,

    I’ve checked the console logs for m-datatable–on-check and I can’t figure out how to extract all the fields in the selected row so I can display it in textboxes. Can you guide me on how to do it? TIA

    Attachments:
    You must be logged in to view attached files.
    Jai
    Jai
    Keymaster

    Posts: 1276
    Support Staff Reply #15097

    Hi 🙂

    Can you try this code?

    var datatable = $(‘.m_datatable’).mDatatable(options).on(‘m-datatable–on-check’, function() {
    // select active rows
    datatable.row(‘.m-datatable__row–active’);
    // check selected nodes
    if (datatable.nodes().length > 0) {
    console.log(datatable.nodes().data(‘obj’));
    }
    });

    Thanks


    mhykgyver
    Participant

    Posts: 23
    Member Reply #15111

    Hi Jai,

     

    thanks for the snippet, I added it to my code and it seems that I’m getting nothing for the row, it’s empty as per screesnhot of the console log:

     

    Attachments:
    You must be logged in to view attached files.

You must be logged in to reply to this topic.