how to do —— Inline() update the link table

how to do —— Inline() update the link table

wujingjingwujingjing Posts: 10Questions: 4Answers: 1

$('#cqjslk_order').on('click', 'tbody td:not(:first-child)', function (e) { var index = $(this).index(); if (index == 1) { return; } else if (index == 2) { editor.inline(this, 'o.crm_id'); } else if (index == 4) { editor.inline(this, 'o.service_id'); } else if (index != 8) { editor.inline(this, { onBlur: 'submit', drawType: 'full-hold' }); } else { editor.inline(); } });

If you do not use editor. Inline (this, 'o.service_id');
Whether it can be obtained dynamically—— 'o.service_id' or 'o.crm_id'.
What should I do if I have three tables or more?

This question has an accepted answers - jump to answer

Answers

  • wujingjingwujingjing Posts: 10Questions: 4Answers: 1

    $('#cqjslk_order').on('click', 'tbody td:not(:first-child)', function (e) { editor.inline(this); });
    If you use it directly,

    prompt:
    Uncaught Unable to automatically determine field from source. Please specify the field name. For more information, please refer to https://datatables.net/tn/11

  • allanallan Posts: 63,602Questions: 1Answers: 10,486 Site admin
    Answer ✓

    The link in the error message gives a description of what is causing the issue and also how to resolve it. Basically you need to tell Editor what field you want the cell to edit since its automatic mapping isn't detecting the field itself. You can use columns.editField for that.

    Allan

  • wujingjingwujingjing Posts: 10Questions: 4Answers: 1

    Thank you.
    I still need to learn more about the API. ;)

This discussion has been closed.