nate-strauser / meteor-x-editable-bootstrap

Smart package for x-editable in place editor

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

breaks on client

DirkStevens opened this issue · comments

After install with Meteorite this component introduces a client side crash.

(something with "defaults")

after remove of the package my app worked again

can you provide more details? i have no issue using this package with latest meteor/meteorite. no complaints from other users either.

Hi Nate -

Meanwhile I believe that the problem could be because of another library corrupting the global namespace. I'll give X-Editable a new try and let you know.

Cheers!

Nathan:

Do you happen to have any examples of the collection update after calling x-editable like:

$('a.editable-click').unbind('save').on('save', function(e, params) {
    console.log('Saved value: ' + params.newValue + params);
    // Make changes to your collection here.
});

tdemarest -> i dont think you can use it that way b/c per the x-editable docs that event only gets fired when the data is already saved Fired when new value was submitted. - the would work if xeditable made an ajax request to save the data like you would have in a more traditional server side framework application - b/c we do the data editing client side with meteor, it doesnt work that way - you have to override the success function as shown in the readme to do the saving yourself

This is how I do it

$('a.editable-click.name').unbind('save').on('save', function(e, params) {
    Meteor.call('updateOpportunityName', this.dataset.pk, params.newValue);
}).editable({
    mode: 'inline',
    disabled: toggleDisabledEditable(),
    validate: function(value) {
        if($.trim(value) == '') return 'This field is required';
    }
});

Just be sure to call it in the Template.name.rendered =

Austin Rivas
P: 407-462-9815

On Jun 3, 2013, at 2:54 PM, tdemarest notifications@github.com wrote:

Nathan:

Do you happen to have any examples of the collection update after calling x-editable like:

$('a.editable-click').unbind('save').on('save', function(e, params) {
console.log('Saved value: ' + params.newValue + params);
// Make changes to your collection here.
});

Reply to this email directly or view it on GitHub.