The documentation doesn't have any example for how to use .submit( [eventData], handler(eventObject) )
I have the following function, where I need to pass in the url to the row_save() function.
function row_edit() {
var url = $(this).attr("href");
var row = $(this).closest('tr')
row.load(
url + "/",
null,
function () {
$("#save-form").submit(url, row_save); // ?? Not sure
}
);
return false;
}
function row_save() {
var url = ????
var item = $(this).parent();
var data = {
item_description: item.find("#id_item_description").val()
};
$.post(url, data, function (result) {
if (result != "failure") {
item.before($("li", result).get(0));
item.remove();
$(".row_edit").click(row_edit);
}
else {
alert("Failed to validate before saving.");
}
});
return false;
}
Thanks
eventData A map of data that will be passed to the event handler
function () {
$("#save-form").submit({ "url": url }, row_save);
}
function row_save(ev) {
var url = ev.data.url;
// ...
}
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