How do I pass an data-attribute to the editor when updating data?

How do I pass an data-attribute to the editor when updating data?

umschoolumschool Posts: 5Questions: 3Answers: 0

Hi
There is an attribute in the table row:
data-contract-id="' + row.id + '"

How can I pass the attribute value from the desired row when updating data through the editor ?

response: 'json',
                    dataType: 'json',
                    data: function () {
                        return {
                            id: tableKpi.ids()[0],
                            name: editorKpi.field('name').val(),
                            description: editorKpi.field('description').val(),
                            amount: editorKpi.field('amount').val(),
                            contract: <-- **Here is the attribute data**
                        };
                    }

Answers

  • allanallan Posts: 63,498Questions: 1Answers: 10,470 Site admin

    Can you give me a link to your page as there are a few possibilities here?

    The best thing to do would be to have the contract id as another field in the form. That way it will handle multi-row editing (assuming the server-side does in this case?). Is that not possible for some reason? It the contract id not in the data that is used to populate the table?

    Allan

Sign In or Register to comment.