Given
$(".foo").editable("script.php")
How can I pass the ID of .foo
's parent as a parameter? I've tried
$(".foo").editable("script.php", {
submitdata: {
parent_id: $(this).parent().attr('id')
}
});
and every variant of that I can think of, but it just seems like the $(this) object is not working in this context.
I had the same problem here, found the following solution:
$('.jeditable').each(function() {
var $this = $(this);
$this.editable('submit.jsp', {
submitdata : { parent_id : $this.parent().attr('id') }
});
});
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With