Using jEditable

Using jEditable

Phil HPhil H Posts: 20Questions: 0Answers: 0
edited November 2010 in General
Hi there,

I have just been reading about being able to edit rows using jEditable. This is a function that I would like to use but cant really get my head around how to implement it, maybe you could answer a couple of questions for me

1. I have added the jeditable.js and the initiation code (from the example) and can now click on a cell in a table andan edit box comes up. If I change some text and move to another row or cell what is supposed to happen? I see a reference to "editable.php", is this triggered for each change ?
2. When I click on a cell to edit it the edit box appears above the current cell details rather than implace of the existing text and the font is very small ... is that controlled within the CSS ?

A great product, many thanks
Regards
Phil

Replies

  • allanallan Posts: 63,498Questions: 1Answers: 10,471 Site admin
    1. Yes - with jEditable you can have it perform whatever action based on it's initialisation. In my demo I've got it doing an XHR. have a look at the jEditable documentation for more information on it though, as I'm far from an expert: http://www.appelsiini.net/projects/jeditable .

    2. I don't quite understand. http://datatables.net/examples/api/editable.html - if I click on 'Firefox 3.0' for example that text gets replaced by a text box with the label inside it. But yes, this can be fully controlled by standard CSS.

    Allan
  • Phil HPhil H Posts: 20Questions: 0Answers: 0
    Hi Allan,

    So does this 'editable_ajax.php' get triggered when ever a field is changed ?. If so what format is the data passed in ?, do I use $_POST to get at it.

    The layout of the field is odd and seems to contain a tab or two before the data ... I dont think I can attach a screen print here but if you have a way of receiving them I can show you what I get

    Regards
    Phil
  • allanallan Posts: 63,498Questions: 1Answers: 10,471 Site admin
    The Ajax request is sent when the field is submitted (i.e. press enter). As for the format - if you have a look at the XHR in Firebug you'll see the parameters which are being sent, and yes these can be picked up by using either _POST or GET, depending on the XHR method used.

    Allan
  • Phil HPhil H Posts: 20Questions: 0Answers: 0
    Hi Allan,

    Maybe this is where I am going wrong, I have just a simple PHP program where you have 'editable.php' in the example. Would that work ?, I assume when you say that 'enter is pressed' that is the submitting the form when all the edits have taken place is, multiple fields for multiple records, is that right ?. I'm not sure what XHR is , but when I use GET or POST am I expecting an array ?,

    Do you have an example that shows data be loaded from a table, being changed in datatables and then the changes being picked up by a program that would process them ?.

    Regarding the layout problem can I send a screenshot to your email address ?

    Regards
    Phil
This discussion has been closed.