get_my/client/AdminMgmt/StoreMgmt/storeMgmtTbl.js
2022-08-26 11:18:18 -05:00

35 lines
No EOL
975 B
JavaScript

import { Stores } from '../../../imports/api/stores';
Template.storeMgmtTbl.onCreated(function() {
this.subscribe("storeInfo");
});
Template.storeMgmtTbl.onRendered(function() {
Meteor.setTimeout(function() {
$('.tooltipped').tooltip();
}, 150);
});
Template.storeMgmtTbl.helpers({
mgmtStoreInfo: function() {
return Stores.find({});
},
});
Template.storeMgmtTbl.events({
'click .deleteStore' (event) {
event.preventDefault();
Session.set("deleteId", this._id);
Session.set("method", "delete.store");
Session.set("item", this.storeName);
Session.set("view", "Stores");
$('#modalDelete').modal('open');
},
'click .editStore' (event) {
event.preventDefault();
Session.set("storeIdEdit", this._id);
let storeInfo = Stores.findOne({ _id: this._id });
$("#storeName").val(storeInfo.storeName);
Session.set("editModeStore", true);
},
});