I tried using my own update event but I don’t seem to make it work.
Where does the connector expect to find the field names? As you can see in my log it says “incorrect field name”.
I am trying to update a record by using dep_id as an id value even though I display it in my grid as the name of the department. (e.id instead of d.department).
$grid->sql->attach("Update","UPDATE employee_for_dhtmlx SET firstname='{firstname}', lastname='{lastname}', start_date='{start_date}', end_date='{end_date}', dep_id='{dep_id}', hours='{hours}', kids='{kids}', insurance='{insurance}', comments='{comments}' WHERE employee_id='{employee_id}'");
$grid->render_sql(
"SELECT e.employee_id, e.dep_id, e.firstname, e.lastname, e.start_date, e.end_date, e.hours, d.department, e.kids, e.insurance, e.comments
FROM employee_for_dhtmlx e, departments d
WHERE e.dep_id = d.dep_id","e.employee_id", "firstname,lastname,start_date,end_date,hours,department,kids,insurance,comments,dep_id,employee_id");
====================================
Log started, 30/08/2012 11:08:47
SELECT DISTINCT department
as value FROM employee_for_dhtmlx e, departments d WHERE ( e.dep_id = d.dep_id)
SELECT e.employee_id, e.dep_id, e.firstname, e.lastname, e.start_date, e.end_date, e.hours, d.department, e.kids, e.insurance, e.comments
FROM employee_for_dhtmlx e, departments d WHERE ( e.dep_id = d.dep_id) LIMIT 0,1000
SELECT COUNT(*) as DHX_COUNT FROM employee_for_dhtmlx e, departments d WHERE ( e.dep_id = d.dep_id)
Done in 0.30638098716736s
====================================
Log started, 30/08/2012 11:08:56
DataProcessor object initialized
1346320727x18_gr_id => 1346320727x18
1346320727x18_c0 => Test
1346320727x18_c1 => TestLastName
1346320727x18_c2 => 2012-08-30
1346320727x18_c3 =>
1346320727x18_c4 => 8
1346320727x18_c5 => IT
1346320727x18_c6 => 0
1346320727x18_c7 => ΙΚΑ
1346320727x18_c8 =>
1346320727x18_!nativeeditor_status => updated
ids => 1346320727x18
Row data [1346320727x18]
e.employee_id => 1346320727x18
firstname => Test
lastname => TestLastName
start_date => 2012-08-30
end_date =>
hours => 8
department => IT
kids => 0
insurance => ΙΚΑ
comments =>
!nativeeditor_status => updated
Incorrect field name used: dep_id
data
e.employee_id => 1346320727x18
firstname => Test
lastname => TestLastName
start_date => 2012-08-30
end_date =>
hours => 8
department => IT
kids => 0
insurance => ΙΚΑ
comments =>
!nativeeditor_status => updated
Incorrect field name used: employee_id
data
e.employee_id => 1346320727x18
firstname => Test
lastname => TestLastName
start_date => 2012-08-30
end_date =>
hours => 8
department => IT
kids => 0
insurance => ΙΚΑ
comments =>
!nativeeditor_status => updated
UPDATE employee_for_dhtmlx SET firstname=‘Test’, lastname=‘TestLastName’, start_date=‘2012-08-30’, end_date=’’, dep_id=’’, hours=‘8’, kids=‘0’, insurance=‘ΙΚΑ’, comments=’’ WHERE employee_id=’’
Edit operation finished
0 => action:updated; sid:1346320727x18; tid:1346320727x18;
Done in 0.12215709686279s