jEditable selects problems
jEditable selects problems
I'm not sure this is the right place for this, but a lot of people are using jEditable here, so I though I would ask.
My problem can be split into two parts:
1. jEditable allows users to put a drop down list, e.g.
[code]
$('.editable').editable('http://www.example.com/save.php', {
data : " {'E':'Letter E','F':'Letter F','G':'Letter G', 'selected':'F'}",
type : 'select',
submit : 'OK'
});
[/code]
My problem is that jEditable puts the key into the table, instead of the value. i.e. when the user selects 'Letter E', then the table displays 'E' instead of 'Letter E'.
2. How do I find out which row has been edited? I need to update a javascript variable on the page when the values are changed.
My problem can be split into two parts:
1. jEditable allows users to put a drop down list, e.g.
[code]
$('.editable').editable('http://www.example.com/save.php', {
data : " {'E':'Letter E','F':'Letter F','G':'Letter G', 'selected':'F'}",
type : 'select',
submit : 'OK'
});
[/code]
My problem is that jEditable puts the key into the table, instead of the value. i.e. when the user selects 'Letter E', then the table displays 'E' instead of 'Letter E'.
2. How do I find out which row has been edited? I need to update a javascript variable on the page when the values are changed.
This discussion has been closed.
Replies
[code]
$('.editable').editable('http://www.example.com/save.php', {
data : " {'Letter E':'Letter E','Letter F':'Letter F','Letter G':'Letter G', 'selected':'Letter F'}",
type : 'select',
submit : 'OK',
callback: function() {
// use "this" to refer to your original element
console.log(this);
}
});
[/code]
2) use callback. "this" is your original element
With regards to 1) - I am loading the values from a database. The code loads the primary key and the value for the list. Looks like I will have to hack it so that it works.