Form Update Error

Ivalid ID for updateItemwebix.log @ webix_debug.js:440webix.assert_error @ webix_debug.js:28webix.assert @ webix_debug.js:14webix.DataStore.updateItem @ webix_debug.js:9788(anonymous function) @ webix_debug.js:10007webix.EventSystem.callEvent @ webix_debug.js:524webix.DataStore.updateItem @ webix_debug.js:9798(anonymous function) @ webix_debug.js:10315webix.BindSource.setBindData @ webix_debug.js:3337save @ webix_debug.js:3288(anonymous function) @ VM4552:2InjectedScript._evaluateOn @ VM4551:905InjectedScript._evaluateAndWrap @ VM4551:838InjectedScript.evaluate @ VM4551:694

Invalid mixing targetwebix.log @ webix_debug.js:440webix.assert_error @ webix_debug.js:28webix.assert @ webix_debug.js:14webix.extend @ webix_debug.js:69webix.DataStore.updateItem @ webix_debug.js:9792(anonymous function) @ webix_debug.js:10007webix.EventSystem.callEvent @ webix_debug.js:524webix.DataStore.updateItem @ webix_debug.js:9798(anonymous function) @ webix_debug.js:10315webix.BindSource.setBindData @ webix_debug.js:3337save @ webix_debug.js:3288(anonymous function) @ VM4552:2InjectedScript._evaluateOn @ VM4551:905InjectedScript._evaluateAndWrap @ VM4551:838InjectedScript.evaluate @ VM4551:694

Uncaught TypeError: Cannot read property ‘_webix_proto_wait’ of undefined
at Object.webix.extend (http://my.app/build/js/vendor-3b5fc142.js:79:10)
at Object.webix.DataStore.updateItem (http://my.app/build/js/vendor-3b5fc142.js:9799:10)
at Object. (http://my.app/build/js/vendor-3b5fc142.js:10014:12)
at Object.webix.EventSystem.callEvent (http://my.app/build/js/vendor-3b5fc142.js:531:24)
at Object.webix.DataStore.updateItem (http://my.app/build/js/vendor-3b5fc142.js:9805:8)
at Object.updateItem (http://my.app/build/js/vendor-3b5fc142.js:10322:44)
at Object.webix.BindSource.setBindData (http://my.app/build/js/vendor-3b5fc142.js:3344:10)
at Object.save (http://my.app/build/js/vendor-3b5fc142.js:3295:33)
at :2:24
at Object.InjectedScript._evaluateOn (:905:140)webix.extend @ webix_debug.js:72webix.DataStore.updateItem @ webix_debug.js:9792(anonymous function) @ webix_debug.js:10007webix.EventSystem.callEvent @ webix_debug.js:524webix.DataStore.updateItem @ webix_debug.js:9798(anonymous function) @ webix_debug.js:10315webix.BindSource.setBindData @ webix_debug.js:3337save @ webix_debug.js:3288(anonymous function) @ VM4552:2InjectedScript._evaluateOn @ VM4551:905InjectedScript._evaluateAndWrap @ VM4551:838InjectedScript.evaluate @ VM4551:694

form getValues returns

$unitValue: “Ağustos 2015”
client_id: 699
created_at: “2015-08-25 13:49:10”
date: Tue Aug 25 2015 00:00:00 GMT+0300 (Turkey Daylight Time)
descriptionT: “”
id: 791
invoice_no: “”
location: “social”
name: “791”
status: “active”
total: 0
total2: “65.00 ₺”
updated_at: “2015-08-25 13:49:10”

I binded them.
$$(‘proforma_form’).bind($$(‘proforma_list’));

And that error happens when I save the form.
$$(‘proforma_form’).save();

Is error occurs for all records or only for newly added one? Which logic you are using for real data saving ( to the server side ) ?

It seems that after adding a new record to the dataset, the ID was updated, so it was changed in the original dataset but was not changed in the linked form. That looks as a wrong behavior, but I can’t reconstruct the same behavior locally.

I’ve found the issue described here. First off, the misspelled “invalid” as “ivalid” is still in the v4.1.0 stack.

The issue occurs with the following steps:

  1. set a datatable to sync:
    $$(“mydt”).data.sync(somedc);

  2. set a function to run the same code and a refresh:
    $$(“mydt”).data.sync(somedc);
    $$(“mydt”).refresh();

  3. at this point the ui seems in good order and displays correctly

  4. attach an “onAfterEditStop” event to $$(“mydt”) and edit the a cell in the dt

The “ivalid” id error will occur and it seem to be something behind the scenes in the dataset as maksim described.

As a work around, I’ve added the following prior to step 2 above:
$$(“mydt”).data.unsync();
$$(“mydt”).clearAll();

Then when the new sync is setup all appears fine. In retrospect, this may be reasonable behavior since the sync was requested in step 1. If not, hopefully, these steps help Webix fix the issue.

Hi,

It seems that you are calling sync for the same widget multiple times. With current version ( 4.2 ) it will lead to inconsistent state as a component will try to sync self multiple times.

Starting from version 4.3, a component will automatically call “unsync” when it is synced to a new data source. It must resolve issue in the above case.