Client side editing issue

Client side editing issue

YOMYOM Posts: 14Questions: 5Answers: 0

I am currently using datatables editor to join together several related MySQL tables and display them in one interface. Each table has a key which are used to tie together the tables via joins. Currently, inline editing fails to change anything without error.

This is what the inline editor currently generates as a request:
action: edit data[row_3846ee0bc1093846ee0bc1090ee0bc1093846ee0bc1093846ee0bc1093846ee0bc1093846ee0bc1093846ee0bc1093846ee0bc1093846][p][cond]: tes data[row_3846ee0bc1093846ee0bc1090ee0bc1093846ee0bc1093846ee0bc1093846ee0bc1093846ee0bc1093846ee0bc1093846ee0bc1093846][pf][order_fufillment_id]:

After using Postman to test out the server side script, I realized that I would need pf.product_id to change p.cond. This is the id for the product table that contains cond.

Is there anyway for me to modify what data is being sent to the server side processing script when editing?

This question has an accepted answers - jump to answer

Answers

  • allanallan Posts: 50,842Questions: 1Answers: 7,620 Site admin
    Answer ✓

    Here is an example with local editing and a joined table: http://live.datatables.net/layonado/2/edit .

    You are correct that you need the extra information, so something needs to look that up. In my example above I used dependent() to do that look up into a hidden form field.

    Allan

  • YOMYOM Posts: 14Questions: 5Answers: 0

    Hey Allan,

    I appreciate the help, I did not know about that API call it may come in handy at some point.

    However, the issue was only happening in inline editing and it was discovered that the submit: 'allIfChanged' was missing in the .inline() function call. Without this it was only sending a few fields, and not the correct ones to for the serverside script to succeed.

    editor_join.inline( this, {
        buttons: { label: '>', fn: function () { this.submit(); } },
        submit: 'allIfChanged'
    });
    
Sign In or Register to comment.