On Jan 22, 2008, at 4:29 PM, daweb wrote:
and this is the Js code in which I'm trying to use the plugin:
$(".clickOnThisSelect").editable
("<?=site_url('admin/entries/update_options/'.$this->idEntryCod)?>",
{
indicator : "<img src='<?=site_url('assets/images/icons/loader.gif')?
'>",
tooltip : "<?=$this->lang->line('clickToEdit')?>",
name : "newvalue",
id : "elementid",
data : data.selectmessage.select_1[0], **************************
type : "select",
onblur : "cancel",
submit : "OK",
cssclass : "clickOnThisSelect"
});
**************************
How can I dinamically change data.selectmessage.select_1[0] whit
data.selectmessage.n[0]? Is it possible?
I do not fully understand what you are trying to do, but the data
parameter can be a function. This function can dynamically set the
values to what you want them to be. For example something like:
$(".editable").editable("http://www.example.com/save.php", {
type : "select",
submit : "OK",
data: function(value, settings) {
if (something) {
retval = data.selectmessage.select_1[0]
} else {
retval = data.selectmessage.select_2[0]
}
return retval;
}
});
--
Mika Tuupola
http://www.appelsiini.net/