add the jEditable-Function only for one cell

add the jEditable-Function only for one cell

BastiBasti Posts: 4Questions: 0Answers: 0
edited September 2011 in Plug-ins
Hello. First, sorry for my bad English. Is it possible that adding the jEditable function of the DataTable to click in a cell just for this?
My problem is this: I have a table with 30 columns and 25 rows, and here the drawing in Internet Explorer takes a long time, since each cell is drawn for an editable field (700 times).
So I add the jEditable function to the table:

[code]
$('#example').dataTable().makeEditable(
sUpdateURL: function(value, settings)
{..},
"aoColumns": [
null, {}, …
])
[/code]

Replies

  • BastiBasti Posts: 4Questions: 0Answers: 0
    Hi @ all. Is it not possible or has no one an idea to realize this?
  • fbasfbas Posts: 1,094Questions: 4Answers: 0
    edited September 2011
    yes, it's possible.

    $(thatcell).editable();

    please read http://www.appelsiini.net/projects/jeditable
  • BastiBasti Posts: 4Questions: 0Answers: 0
    Hi fbas,
    thanks for the answer, but there is the same problem. When I check the application with the firebug, the function starting at line 108 in the file "jquery.jeditable.js" is called over 700 times.

    That´s my code:
    [code]
    var oTable = $('#example').dataTable();
    $('td', oTable.fnGetNodes()).editable();
    [/code]

    Do you have an example where this function is called only 1 time for the "clicked cell"?
  • BastiBasti Posts: 4Questions: 0Answers: 0
    I wrote my "own" editable field, problem is solved:
    [code]
    $('#example tbody td').dblclick( function () {
    var aPos = oTable.fnGetPosition( this );
    var aColIndex = oTable.fnGetPosition(this)[2];
    var aData = oTable.fnGetData( aPos[0] );
    ...
    this.innerHTML = '';
    ...
    var inputText = document.getElementById("editable");
    inputText.onblur = function (){
    this.outerHTML = inputText.value;
    }
    inputText.onkeydown = function(e) {
    var e = e || window.event;
    if (e.keyCode == 27) {
    this.blur();
    }
    ...
    [/code]
  • fbasfbas Posts: 1,094Questions: 4Answers: 0
    use jquery selectors, whether it's for all cells, or all items with a certain classname, etc.

    $(selector).editable();
This discussion has been closed.