Jeditable dynamic target
I am using jeditable and it works great! I am just having trouble figuring out how to dynamically change the target url.
jeditable is bound to a table of values ββthat I want to edit inline. So I have:
<td id="<%= col.id %>_<%= i.id %>" class="edit">
The id is a mashup of two values ββthat I need to know to edit this element on the server side.
My js:
$(document).ready(function() {
$('.edit').editable("/items/1", {
id : "column_id_item_id",
submitdata : function(value, settings){
return { data_template_id: '<%= @data_template.id%>}', format : 'json'}
} ,
method : 'PUT',
});
});
Note that the target url "/ items / 1"
This is / 1 is what I need to change and its one of the values ββembedded in the td id.
So my question is how to take the value from the id of the element that was clicked and use it to change the target parameter for jeditable.
Everything else works fine, I'll just edit item 1 every time right now :)
+2
a source to share