if (response.status == 402) { /* 'Payment Required' stands
in for cache miss */
if (self._retried_map_key_already) {
- console.error("Server won't cache flattener map?");
+ var e = new FlattenerStoreError(
+ "Server won't cache flattener map?"
+ );
+ if (typeof req.onError == "function")
+ req.onError.call(callback_scope, e);
+ else
+ throw e;
} else {
self._retried_map_key_already = true;
delete self.mapKey;
}
});
- /* as for onError: what to do? */
-
return req;
},
* need most of the methods. */
"deleteItem": function(item) {
- console.warn("[unimplemented] deleteItem() XXX TODO");
+ //console.log("deleteItem()");
+
+ var identity = this.getIdentity(item);
+ delete this._current_items[identity]; /* safe even if missing */
+
+ this.onDelete(item);
},
"setValue": function(item, attribute, value) {
"fmClass": null,
"fmIdentifier": null,
"mapExtras": null,
- "defaultSort": null, /* whatever the UI says /replaces/ this */
- "baseSort": null, /* whatever the UI says /follows/ this */
+ "defaultSort": null, /* whatever any part of the UI says will
+ /replace/ this */
+ "baseSort": null, /* will contains what the columnpicker
+ dictates, and precedes whatever the column
+ headers provide. */
/* These potential constructor arguments are for functionality
* copied from AutoGrid */
delete this.editPane;
dojo.style(this.domNode, "display", "block");
this.update();
+ },
+
+ "deleteSelected": function() {
+ var self = this;
+
+ this.getSelectedItems().forEach(
+ function(item) {
+ var fmobj = new fieldmapper[self.fmClass]();
+ fmobj[self.fmIdentifier](
+ self.store.getIdentity(item)
+ );
+ (new openils.PermaCrud()).eliminate(
+ fmobj, {
+ "oncomplete": function() {
+ self.store.deleteItem(item);
+ }
+ }
+ );
+ }
+ );
}
}
);