Hello folks,
I want to dynamically update a parameter value when using jEditable.
The following function loads a div on the current page with new
content relating to an item ID of fID (selected from a list of items
in another div on the page). I then use jEditable to allow the user
to update the content of that item. That bit works fine on the first cycle.
However, when I select and load in another item with a different fID,
I cannot get jEditable to update its value for fID, either in the URL
(first arrow) or through the submitdata function (second arrow).
How do I alter my function to make this possible?
function getDashItem(fID){
$.ajax({
type: 'GET',
url: "scripts/ajax_tasks.asp?id=getdashitem&fID="+fID+"&q="
+ new Date().getTime(),
dataType: "json",
success: function(json){
if (json.fields) {
for (var i = 0; i < json.fields.length; i++) {
var field = json.fields[i];
switch(field.yesno) {
case "Y":
$("#alerts").html(field.dash_alerts);$("#desc").html(field.dash_desc);
--->>>
$(".edit").editable("scripts/ajax_tasks.asp?id=jedit&fID="+fID, {
indicator : "<img
src='images/indicator.gif'>",
submit : 'OK',
id : 'jID',
--->>> submitdata : function() {
return {foo: fID}
},
type : 'textarea',
width : '95%',
tooltip : "Click to edit..."
});
break;
case "N":
$("#help1").html(field.message).fadeIn(500);
}
}
}
}
});