Editor send empty data when I invoke editor.edit() from the DataTable's child row
Editor send empty data when I invoke editor.edit() from the DataTable's child row
Hi, Allan.
I write application for working with freelancers. In the table I told about, I want select avtor for new orders from list of all freelancers.This list is shown in child row.
Debug code is: iwawuk
This is my code with editor declarations.
var tpar,crid,editor;
(function($){
$(document).ready(function() {
editor = new $.fn.dataTable.Editor( {
ajax: 'php/table.modx_vkrzakaz_sm.php',
table: '#modx_vkrzakaz',
i18n: {
......
},
fields: [
{
"label": "\u2116 \u0437\u0430\u043a\u0430\u0437\u0430",
"name": "modx_vkrzakaz.no_zak"
},
{
"label": "\u041a\u043b\u0438\u0435\u043d\u0442",
"name": "modx_vkrklient.fio"
},
{
"label": "\u0410\u0432\u0442\u043e\u0440",
"name": "modx_vkrzakaz.avt_zak",
"type": "select"
},
{
"label": "\u0412\u0438\u0434 \u0437\u0430\u043a\u0430\u0437\u0430",
"name": "modx_vkrzakaz.vid_zak",
"type": "select"
},
{
"label": "Тема",
"name": "modx_vkrzakaz.tema_zak"
},
{
"label": "Предприятие",
"name": "modx_vkrzakaz.predpr_zak"
},
{
"label": "Срок заказа",
"name": "modx_vkrzakaz.srok_zak"
},
{
"label": "Приоритет",
"name": "modx_vkrzakaz.priority"
},
{
"label": "\u042d\u0442\u0430\u043f 1",
"name": "modx_vkrzakaz.is_step1",
"type": "checkbox",
"separator": "|",
"options": [
{label: '', value: '1'}
]
},
{
"label": "\u042d\u0442\u0430\u043f 2",
"name": "modx_vkrzakaz.is_step2",
"type": "checkbox",
"separator": "|",
"options": [
{label: '', value: '1'}
]
},
{
"label": "\u042d\u0442\u0430\u043f 3",
"name": "modx_vkrzakaz.is_step3",
"type": "checkbox",
"separator": "|",
"options": [
{label: '', value: '1'}
]
},
{
"label": "\u042d\u0442\u0430\u043f 4",
"name": "modx_vkrzakaz.is_step4",
"type": "checkbox",
"separator": "|",
"options": [
{label: '', value: '1'}
]
},
{
"label": "\u042d\u0442\u0430\u043f 5",
"name": "modx_vkrzakaz.is_step5",
"type": "checkbox",
"separator": "|",
"options": [
{label: '', value: '1'}
]
},
{
"label": "\u042d\u0442\u0430\u043f 6",
"name": "modx_vkrzakaz.is_step6",
"type": "checkbox",
"separator": "|",
"options": [
{label: '', value: '1'}
]
},
{
"label": "\u042d\u0442\u0430\u043f 7",
"name": "modx_vkrzakaz.is_step7",
"type": "checkbox",
"separator": "|",
"options": [
{label: '', value: '1'}
]
},
{
"label": "\u0421\u0443\u043c\u043c\u0430 \u0437\u0430\u043a\u0430\u0437\u0430",
"name": "modx_vkrzakaz.sum"
},
{
"label": "\u041e\u043f\u043b\u0430\u0447\u0435\u043d\u043e",
"name": "modx_vkrzakaz.sum_opl"
}
]
} );
This discussion has been closed.
Replies
And this is my table declaration
Then I open child row i`ll try to modify parent table row with this code:
'button#set_avt' is the button under "Автор" column in child row.
Editor write nothing... Then I test it in console, I see that editor send empty data, but than I edit row table with standart way ('Редактировать' button), all work clearly.
This is Php code for this table:
This is link to my case:
http://uchet.nuzenavtor.ru/Ed-15/dt/vkr_raspred.html
That's I do wrong?
Thanks for any advice,
Regards,
Vitaliy.
HI Vitaliy,
In your Javascript you have:
It should be:
The
edit()
method takes a row selector which can be a selector string or atr
node. In this case you are using a string so you need to make it an id selector.Thanks,
Allan
Thanks, Allan.
This resolve my problem.