form.reset() doesn't work w/ datastore (and a workaround)

form.reset() seems to do nothing on a form that is bound to a grid, which is in turn synced to a datastore. Like this:

			var dsRestaurants = new dhtmlXDataStore({ url:'./codebase/data/rest_data.php', datatype:'xml' });
...
			dpRestaurants = new dataProcessor('./codebase/data/rest_data.php');
			dpRestaurants.init(dsRestaurants);
...
			restaurant_grid.sync(dsRestaurants);
...
			detail_form.bind(restaurant_grid);
...
			detail_form.attachEvent("onButtonClick", function(id){
				var prevRecord = restaurant_grid.getSelectedRowId();
				if (id=='btn_submit'){
						detail_form.save();
				}
				else if (id=='btn_cancel'){
						detail_form.reset(); <---DOES NOTHING
				}

My temporary workaround is to move the grid off the current record and back, like so.

				else if (id=='btn_cancel'){
						restaurant_grid.selectRowById(+prevRecord + 1); //wouldn't have to do this if detail_form.reset method worked here
						restaurant_grid.selectRowById(prevRecord);
				}

This works okay, but has some drawbacks, so if I could get a hint as to how to make the reset method work, I’d appreciate it.

Thanks.

TAC

With lots of dedicate searching on this forum, I learned that form.reset doesn’t work with datastores (though it should, IMO).

The official suggested workaround is to reload the form data with the data.pull method (which, as far as I can tell, is not in the documentation).

				else if (id=='btn_cancel'){
						detail_form.setFormData(dsRestaurants.data.pull[restaurant_grid.getSelectedId()]);
						detail_form.setItemFocus("Name");
				}

This works perfectly.