jEditable selects problems

jEditable selects problems

jagdipajagdipa Posts: 14Questions: 0Answers: 0
edited August 2011 in General
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.

Replies

  • fbasfbas Posts: 1,094Questions: 4Answers: 0
    1) change the keys as you see fit
    [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
  • jagdipajagdipa Posts: 14Questions: 0Answers: 0
    Thanks fbas - didnt know about "this" in the callback.

    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.
This discussion has been closed.