Hi guys. Can somebody help with problem.
I have table with fields like pic 1
On template rendered
Template.contactDetails.onRendered(function() {
var self = this
$.each(this.$('.editable'), function(i, el){
var contactID = FlowRouter.getParam('id');
var fieldID = $(el).data('id')
var fieldValue = $(el).data('value')
var field = Fields.findOne({
_id: fieldID
})
...
$(el).editable({
//disabled: true,
showbuttons: false,
savenochange: false,
type: field.type,
source: field.values || '',
value: fieldValue || '',
onblur: 'submit',
success: function(response, newValue) {
Meteor.call('updateContact', contactID, fieldID, newValue, (error, result) => {
if (error) console.log(error)
else {
showNotification('success', 'Contact updated successfully.', 'Success', '1');
}
});
}
This work’s perfectly only first time changing in Contacts collection… Even if manually update collection on rendered not called one more time and x-editable not launch.
Thank’s beforehand.