有人可以告诉我以下代码有什么问题。主要问题是该行:
fDbListAllClients; // this is not being "called"
似乎没有被执行。
也可能存在其他错误代码。我不关心是否有必要检查删除,我想知道是什么导致了不执行相关行的问题。
fDbDeleteOneClient(String sKey) {
var oDbTxn = ogDb1.transaction(sgTblClient, 'readwrite');
var oDbTable = oDbTxn.objectStore(sgTblClient);
var oDbRecord = oDbTable.getObject(sKey);
oDbRecord.onSuccess.first.then((val) {if (oDbRecord.result == null) {
window.alert("Record $sKey not found and cannot be deleted");
return;}});
var oDbDelReq = oDbTable.delete(sKey);
oDbDelReq.onSuccess.first.then((val1) {
var oDbRecord = oDbTable.getObject(sKey); // check if it was deleted
oDbRecord.onSuccess.first.then((val2){
if (oDbRecord.result != null) {
window.alert("Record $sKey was found but cannot be deleted");
}
});
fDbListAllClients; // this is not being "called"
});
oDbDelReq.onError.first.then((e) => window.alert(
"Error on Delete of $sKey. Error = ${e}"));
}