Dhtmlx Connector Not update after complex SQL query

Sorry for inconvenience, correct package is attached.
codebase_latest_v2.zip (174 KB)

I’m afraid I’m getting this error now…

combo.addOption is not a function
[Break on this error] if (combo.addOption([[val, lab]]));
connector.js (line 103)

cheers,

Jason

Please try to update the connector.js with attached one ( in addition to previous update )
Locally it works correctly for all major samples.
connector_js_.zip (4.39 KB)

Magic! Thanks, it’s working great, very much appriciated.

One other problem… all the selects work, but it the update in this and in another strieght render_table setup (below) doesn’t work, nothing in the log (except the select queries)… no js errors etc… is there anything you could think of that I’m doing wrong?

thanks again!

Jason

require_once(“config.php”);
$res=mysql_connect($mysql_server,$mysql_user,$mysql_pass);
mysql_select_db($mysql_db);

require("codebase/grid_connector.php");
$grid = new GridConnector($res);
$grid->enable_log("temp.log",true);

$grid->dynamic_loading(50);
$grid->render_table(“progsafe_people”,“people_ID”,“emp_id,name,surname,ni,dob,job_title”);

Check client side code, are you including connector.js on the page? Is it included after other js files?

If connector.js was not applied correctly, server side may not recognize update calls. ( also it can occur if you manually change data sending mode of dataprocessor )

These are the scripts in my client side page in this order… I’ve tried changing them around but it doesn’t seem to help.

Is there a guide to which order they should appear in?

Yep, it seems as correct order

In case of problematic update operation - does server side log have not any records at all, all have record about select operation instead of update?

The log has all the select queries but none of the update ones…

Can you provide js code snippet, which is used, for client side dataprocessor initialization?

mygrid = new dhtmlXGridObject(‘gridbox’);
mygrid.setImagePath(“codebase/imgs/”);
mygrid.setHeader(“Employee ID, Name,Surame,NI Number,D.O.B.,Job Title”);
mygrid.attachHeader("#connector_text_filter,#connector_text_filter,#connector_text_filter,#connector_text_filter,#connector_text_filter,#connector_text_filter");
mygrid.setInitWidths(“120,120,,,80,80”)
mygrid.setColTypes(“ro,ed,ed,ro,ro,ro”);
mygrid.setColSorting(“connector,connector,connector,connector,connector,connector”);
mygrid.enableSmartRendering(true);
mygrid.enableMultiselect(true);
mygrid.enableAutoWidth(true);

mygrid.init();
mygrid.setSkin("clear");
mygrid.loadXML("users_connector.php");
var dp = new dataProcessor("users_connector.php");
dp.init(mygrid);

I’ve also been playing around witht he before update event (for formatting date) as below… you can see I put an email alert in the update event, it works on the before render, but absolutely nothing on the beforeupdate…

require_once(“config.php”);
$res=mysql_connect($mysql_server,$mysql_user,$mysql_pass);
mysql_select_db($mysql_db);

require("codebase/grid_connector.php");
$grid = new GridConnector($res);
$grid->enable_log("temp.log",true);
$grid->dynamic_loading(100);
$grid->event->attach("beforeRender",myRender);
$grid->event->attach("beforeUpdate",myUpdate);
$grid->render_table("progsafe_people","people_ID","emp_id,name,surname,ni,dob,job_title");

function myUpdate($action){
mail("my@email.com", “dhtmlx info”.date(“H:i:s”),“update called”);
$ps_name = $action->get_value(‘name’);
$ps_surname = $action->get_value(‘surname’);
$ps_ni = $action->get_value(‘ni’);
$ps_dob = $action->get_value(‘dob’);
$ps_dob = date(“Y-m-d”, strtotime($ps_dob));
mysql_query(“UPDATE people_ID SET name=’$ps_name’, surname=’$ps_surname’, ni=’$ps_ni’, dob=’$ps_dob’ WHERE people_ID=’{$action->get_id()}’”);

        $action->success();
    }

function myRender($data){
$this_dob=date(“d-m-Y”,strtotime($data->get_value(“dob”)));
$data->set_value(“dob”,$this_dob);
}

cheers,

Jason

Both client side and server side code looks correctly.
If you have all necessary includes ( dataprocessor and connector.js after it ) - it must work correctly. Can you try to include one more js file

dhtmlxdataprocessor_debug.js

it will generate client side log, so you will be able to check is data sending works correctly, and what server side responds.

I’ve tried this with the origional _debug file, but it doesn’t do anything, there wasn’t a dataprocessor debug file with the latestv2 files you gave me earlier in this thread, do I need an updated one?

… also tried dhtmlxcommon_debug, responds to everything but the update…

Files attached, include both of them instead of default dhtmlxdataprocessor.js

[code]<script src="dhtmlxdataprocessor.js …

<script src="dhtmlxdataprocessor_debug.js ...[/code] <a class='attachment' href='/uploads/default/original/2X/6/6358dbcea6be908be5101a8dbdb7150664db774e.zip'>codebase_dp.zip</a> (23.9 KB)

Hi Stanislav,

I’m afraid I’m still getting the same debug console with DataProcessor, Current state & Log but nothign appears under either heading. I’ve tried latest IE & Firefox & safari… any ideas?

thanks

Can you provide a sample with all used js files ( without server side scripts, I can imitate them locally ) and send such package to the support@dhtmlx.com ?

If log has not any records - it seems that dataprocessor is not initialized correctly, but the sample code, provided previously must result in correct initialization.

Did you recieve all the files?

I think I had accidentally knocked the dataprocessor file off the training page, should be like:

As for training.html - it just misses dhtmlxdataprocessor.js at all, so data saving never was initialized.

As for users.html - problem caused by new version of dataprocessor which doesn’t work with old version of grid. To fix issue - use the attached js file instead of the original one.
dhtmlxdataprocessor.zip (20.8 KB)

Many thanks, all working now!

Are you using co|coro columns in the grid , or #connector_select_filter ?
The above error occurs when complex SQL was used for data rendering and auto-fill for some client side collection requested - exception is thrown because code can’t build the collection filling SQL from provided configuration. :smiley:

You can
a) add next line to server side code

$grid->set_options(“field_name”,array());:slight_smile:

Where field_name name of the field for which you have cocoro column in the grid. :smiley:
(other options can be checked at dhtmlx.com/dhxdocs/doku.php?id=d … ns_in_grid :smiley:

b) you can replace the existing grid_connector.php with provided one, it has auto-filling disabled. :slight_smile: