Many chcanges, but version 0.1.0 is ready to be cut.

This commit is contained in:
Brian McGonagill 2022-08-23 13:41:21 -05:00
parent 42643a37f5
commit 6e37ae8c74
46 changed files with 1038 additions and 273 deletions

View file

@ -5,7 +5,9 @@ Template.prodMgmtTbl.onCreated(function() {
});
Template.prodMgmtTbl.onRendered(function() {
Meteor.setTimeout(function() {
$('.tooltipped').tooltip();
}, 150);
});
Template.prodMgmtTbl.helpers({
@ -15,5 +17,25 @@ Template.prodMgmtTbl.helpers({
});
Template.prodMgmtTbl.events({
'click .deleteProduct' (event) {
event.preventDefault();
Meteor.call('delete.product', this._id, function(err, result) {
if (err) {
console.log(" ERROR deleting product: " + err);
} else {
console.log(" SUCCESS deleting the product.");
}
});
},
'click .editProduct' (event) {
event.preventDefault();
Session.set("prodEditMode", true);
Session.set("prodEditId", this._id);
let prodInfo = Products.findOne({ _id: this._id });
$("#prodName").val(prodInfo.prodName);
$("#prodCategory").val(prodInfo.prodCategory);
$("#prodLocation").val(prodInfo.prodLocation);
$("#prodStore").val(prodInfo.prodStore);
$('select').formSelect();
}
});