0

following is my code. the double click event is not being catch and executed by the jeditable.

javascript:

$(document).ready(function(){
    $(".edit_area").editable('http://my_cgi_url', {
        event       : 'dblclick',
        type        : 'textarea',
        rows        : 3,
        cols        : 30,
        cancel      : 'Cancel',
        submit      : 'Save',
        indicator   : '<img src="images/indicator.gif">',
        placeholder: 'Double Click to enter text',
        tooltip : 'Double Click to edit...',
        name        : 'comment'
     });


    //Please note there is another peice of code which is capturing clikc events inside the table columns,
    // which goes like this...
    //I doubt it is catching the double-click before the above function....
    //I am not sure how to make the editable catch the doubleclick event??....

    var rowi, coli, cellval;  //global as called in other subroutine too....
    $(".mytbl tbody tr").live('click',function (e) {
        rowi = this.rowIndex;
        coli = e.target.cellIndex;
        cellval = $('tr').eq(rowi).find('td').eq(coli).text();
        var propvalue = $('tr').eq(0).find('th').eq(coli).text();
        //and some other functions.....
    });
});

HTML SAMPLE one table record: The id for the edit_area div is unique for each table row.

Table is added after page is loaded, via an ajax call - so the id/divs etc are not present in page on pageload. only the div mytbldiv always exists on page.

<div id="mytbldiv">
    <table class="mytbl" border="1">
        <tr><th>header1</th><th>Header2</th></tr>
        <tr><td>A</td><td><div class="edit_area" id="uniqelementid_forthisrow">text_to_edit</div></td></tr>
    </table>
</div>
rajeev
  • 1,275
  • 7
  • 27
  • 45

1 Answers1

0

the editable has to be run with the javascript code which adds new table to page. that way it gets attached to elements correctly and works as desired.

rajeev
  • 1,275
  • 7
  • 27
  • 45