[jQuery] [jEditable] dynamically updating a parameter value
<html>
<body>
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?
<tt>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);
--->>>
<x-tab> </x-tab><x-tab>
</x-tab>
$(".edit").editable("scripts/ajax_tasks.asp?id=jedit&fID="+fID,
{
<x-tab> </x-tab><x-tab>
</x-tab><x-tab>
</x-tab><x-tab>
</x-tab> indicator
: "<img src='images/indicator.gif'>",
<x-tab> </x-tab><x-tab>
</x-tab><x-tab>
</x-tab><x-tab>
</x-tab>
submit : 'OK',
<x-tab> </x-tab><x-tab>
</x-tab><x-tab>
</x-tab><x-tab>
</x-tab>
id : 'jID',
--->>><x-tab> </x-tab><x-tab>
</x-tab><x-tab>
</x-tab> submitdata
: function() {
<x-tab> </x-tab><x-tab>
</x-tab><x-tab>
</x-tab><x-tab>
</x-tab> return
{foo: fID}
<x-tab> </x-tab><x-tab>
</x-tab><x-tab>
</x-tab><x-tab>
</x-tab> },
<x-tab> </x-tab><x-tab>
</x-tab><x-tab>
</x-tab><x-tab>
</x-tab>
type : 'textarea',
<x-tab> </x-tab><x-tab>
</x-tab><x-tab>
</x-tab><x-tab>
</x-tab>
width<x-tab> </x-tab> : '95%',
<x-tab> </x-tab><x-tab>
</x-tab><x-tab>
</x-tab><x-tab>
</x-tab>
tooltip : "Click to edit..."
<x-tab> </x-tab><x-tab>
</x-tab><x-tab>
</x-tab><x-tab>
</x-tab>
});<x-tab> </x-tab>
break;
case "N":
$("#help1").html(field.message).fadeIn(500);
}
}
<x-tab> </x-tab><x-tab>
</x-tab><x-tab>
</x-tab>}
<x-tab> </x-tab><x-tab>
</x-tab><x-tab>
</x-tab>}
});
</body>
</html>