Possible bug in dataProcessor

Dataprocessor synced to a grid and dhtmlXDataStore.

dataProcessor setUpdateMode(“off”);

custom onAfterUpdate event is set, to update the grid item to use the database auto-populated record id (id).

			dp.attachEvent("onAfterUpdate", function(id, action, tid, response) {
				if (action === 'inserted') {
					/*
					After creating row in the Grid, id is generated automaticaly,
					that is way we should change it
					*/
					var obj = grid.getRowIndex(id);
					grid.setRowId(obj, response.id);

					/*
					updating information in DataStore item
					*/
					var newItem = ds.item(id);
					newItem.id = response.id;
					ds.update(response.id, newItem);
				}

				return true;
			});

adding a record like this (with default values) creates an issue is that upon adding a record, it is shown using “bold font” on the grid. but once calling dataProcessor sendData();
the data is saved correctly to the database and the grid still shows the new record as “bold”.
a 2nd call to sendData(); seems to make the bold go away.

      ds.add({
        'tracking': 'DefaultTracking',
        'pieces': 1,
        'packageType': 'DefaultType',
        'id': 0
      });

but, adding a record like this (without the string default values), just works fine!

      ds.add({
        'pieces': 1,
        'id': 0
      });

Any idea why is it?

Hi please try to change

id:0

to some non zero value, both datatable and datastore may have problems if some item hash id such as 0, null, false.

Nope.

function addRow() {
	var newId = grid.uid();
	ds.add({
		'id': newId
	});

	grid.selectRow(grid.getRowIndex(newId), true);
}

didn’t solve the issue. Any ideas?
Important to note is that the data is actually saved to the database, simply not updated on the grid.

simply not updated on the grid

The most common reason of such issue is the invalid format of response data ( so client side code can’t detect the new id correctly )

If you have the online demo, where issue can be checked, please send me PM with the link.