jeditable on only one column ???

jeditable on only one column ???

DaphneDaphne Posts: 4Questions: 0Answers: 0
edited April 2011 in TableTools
Hi there !

Wonderful tool this Datatables !
Congrats Allan and five thumbs up for the job done !!!

Just two questions :
First, how to limit Jeditable on only one column ??? I don't find the way to do this ... :-(

Second one:

When i try to use DataTables individual column filtering, like in the example, it doesn't works, and i've just my columns on my screen . Any idea ?

Here is the source:
[code]

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">












$(document).ready(function() {
var oTable = $('#example').dataTable( {
"bJQueryUI": true,
"bSortClasses": true,
"bPaginate": true,
"sPaginationType": "full_numbers",
"bProcessing": true,
"bServerSide": true,
"sAjaxSource": "server_processing.php",
"sScrollY": 500,
"bScrollCollapse": true,
"bStateSave":true,
"sDom": '<"top"<"clear">C<"clear">R<"clear"><"clear">fl<"clear">T<"clear">>rt<"clear">i<"clear"><"bottom"p<"clear">>',
"oLanguage": {
"sSearch": "Recherche dans toutes les colonnes:",
"sLengthMenu": "Afficher _MENU_ enregistrements par page",
"sZeroRecords": "Aucun element correspondant",
"sInfo": "Affichage des enregistrements _START_ a _END_ sur _TOTAL_ au total",
"sInfoFiltered": "
( Filtrage sur _MAX_ entrees)"
},

"oTableTools": {
"sSwfPath": "/swf/copy_ cvs _xls_pdf.swf",
"aButtons": [ "copy", "print" ]

},



"fnDrawCallback": function () {
$('td', this.fnGetNodes()).editable( 'editable_ajax.php', {
"callback": function( sValue, y ) {
var aPos = oTable.fnGetPosition( this );
oTable.fnUpdate( sValue, aPos[0], aPos[1] );
},
"submitdata": function ( value, settings ) {
return {"row_id": this.parentNode.getAttribute('id'),
"column": oTable.fnGetPosition( this )[2]
};
alert( 'DataTables has redrawn the table' );
},
"height": "14px"
} );
}








} );
} );


@import "css/Table_Tools.css";
@import "css/Table_Tools_JUI.css";


body { font-size: 75.5%; }
div#users-contain { text-align:left; min-width: 700px; margin: 0px 0; }
div#users-contain table { margin: 0em 0; border-collapse: collapse; width: auto; }
div#users-contain table td, div#users-contain table th { border: 1px dotted #1c94c4; padding: 3px 10px; text-align: left; }












idchamp8champ10champ38champ39








<!--//








-->










[/code]

Thanks to Viperia too, for her post which help me a lot :
http://datatables.net/forums/comments.php?DiscussionID=2754&page=1

Thanks you in advance for your time.

Daphne,
DataTables french user !

Replies

  • DrakoDrako Posts: 73Questions: 0Answers: 0
    $('td:eq(0), td:eq(3)', oTable.fnGetNodes()).editable

    will edit only 1st and 4th columns
  • DaphneDaphne Posts: 4Questions: 0Answers: 0
    Hello DataTables people !

    Thank for your help Drako, it works fine !
    And i found how to use DataTables individual column filtering by myself.

    Now i try to implement the swf button collection and multi-row select, but nothing change on my screen...
    normally my paths are good ( swf folderat the same level as the js one: [code]"sSwfPath": "swf/copy_cvs_xls_pdf.swf",[/code] ), i think i've called the right extension...

    What's wrong ???

    [code]





    var asInitVals = new Array();
    $(document).ready(function() {
    var oTable = $('#example').dataTable( {
    "bJQueryUI": true,
    "bSortClasses": true,
    "bPaginate": true,
    "sPaginationType": "full_numbers",
    "bProcessing": true,
    "bServerSide": true,
    "sAjaxSource": "server_processing.php",
    "sScrollY": 500,
    "bScrollCollapse": true,
    "bStateSave":true,
    "sDom": '<"H"<"top"<"clear">C<"clear">R<"clear"><"clear">lfr<"clear">T<"clear">>t<"clear"><"clear">i<"clear"><"clear"><"bottom"p<"clear">>"F">',

    "oLanguage": {
    "sSearch": "Recherche dans toutes les colonnes:",
    "sLengthMenu": "Afficher _MENU_ enregistrements par page",
    "sZeroRecords": "Aucun element correspondant",
    "sInfo": "Affichage des enregistrements _START_ a _END_ sur _TOTAL_ au total",
    "sInfoFiltered": "
    ( Filtrage sur _MAX_ entrees)"
    },

    "oTableTools": {
    "sSwfPath": "swf/copy_cvs_xls_pdf.swf",
    "sRowSelect": "multi",
    "aButtons": [
    "copy",
    "print",
    {
    "sExtends": "collection",
    "sExtends": "copy",
    "sButtonText": "Save",
    "aButtons": [ "csv", "xls", "pdf" ]
    }
    ],

    "aButtons": [ "select_all", "select_none" ]
    },

    "fnDrawCallback": function () {
    $('td:eq(5)', oTable.fnGetNodes()).editable( 'editable_ajax.php', {
    "callback": function( sValue, y ) {
    var aPos = oTable.fnGetPosition( this );
    oTable.fnUpdate( sValue, aPos[0], aPos[1] );
    },
    "submitdata": function ( value, settings ) {
    return {"row_id": this.parentNode.getAttribute('id'),
    "column": oTable.fnGetPosition( this )[2]
    };
    },
    "height": "24px"
    } );
    }


    } );


    $("tfoot input").keyup( function () {
    /* Filter on the column (the index) of this element */
    oTable.fnFilter( this.value, $("tfoot input").index(this) );
    } );
    /*
    * Support functions to provide a little bit of 'user friendlyness' to the textboxes in
    * the footer
    */
    $("tfoot input").each( function (i) {
    asInitVals[i] = this.value;
    } );

    $("tfoot input").focus( function () {
    if ( this.className == "search_init" )
    {
    this.className = "";
    this.value = "";
    }
    } );
    $("tfoot input").blur( function (i) {
    if ( this.value == "" )
    {
    this.className = "search_init";
    this.value = asInitVals[$("tfoot input").index(this)];
    }
    } );
    } );


    @import "css/Table_Tools.css";
    @import "css/Table_Tools_JUI.css";


    body { font-size: 75.5%; }
    div#users-contain { text-align:left; min-width: 700px; margin: 0px 0; }
    div#users-contain table { margin: 0em 0; border-collapse: collapse; width: auto; }
    div#users-contain table td, div#users-contain table th { border: 1px dotted #1c94c4; padding: 3px 10px; text-align: left; }














    ETC...








    [/code]

    It is there a way to put the DataTables individual column filtering under the names of columns ( in the sDom ) ?

    Thanks again Drako !

    Daphne,
    DataTables french user !
  • DaphneDaphne Posts: 4Questions: 0Answers: 0
    Hello !

    Is it normal that in my source code don't appear ?

    I've just this :
    [code]




    idTerritoirePDCchamp10EAMLibellechamp40

























    [/code]

    I don't find any issue for my last question : It is there a way to put the DataTables individual column filtering under the names of columns ( in the sDom ) ?

    and my try to implement the swf button collection and multi-row select doesn't work ...

    :-(

    Can someone help me please.

    Daphne
This discussion has been closed.