javascript - How to add both toggle and validate options to x-editable? -


i use x-editable inline editor http://vitalets.github.io/x-editable/docs.html

i want toggle inline form other link:

$("#how").click(function(e) {   e.stoppropagation()   e.preventdefault()   $("#com").editable({     'toggle',     validate: function(value) {       if($.trim(value) == '') {         return 'the content can not blank!';       }     }   }) }) 

but not work, want know how pass both toggle , validate option.

seperate options declaration , 'toggle' part trick:

$("#how").click(function(e) {   e.stoppropagation();   e.preventdefault();   $("#com").editable({     validate: function(value) {       if($.trim(value) == '') {         return 'the content can not blank!';       }     }   });   $("#com").editable('toggle'); }); 

hope helpful others :)


Comments

Popular posts from this blog

plot - Remove Objects from Legend When You Have Also Used Fit, Matlab -

java - Why does my date parsing return a weird date? -

Need help in packaging app using TideSDK on Windows -