How insert mData for activate

How insert mData for activate

roca_table1roca_table1 Posts: 4Questions: 0Answers: 0
edited October 2013 in Editor
Who I Can concatenate a Ver only in the table?

I'm using editor of datatables

[code]
$('#ternas13').dataTable( {
"sDom": 'TF<"clear">lfrtip',
"bJQueryUI": true,
"sPaginationType": "full_numbers",
"aaSorting": [[ 0, "asc" ]],
"bStateSave": false,
"sAjaxSource": "php/table.ternas13.php",
"aoColumns": [
{
"mDataProp": "area_academica"
},
{
"mDataProp": "region"
},
{
"mDataProp": "ciudad"
},
{
"mDataProp": "entidad_academica"
},
{
"mDataProp": "nombre"
},
{
"mDataProp": "primero"
},
{
"mDataProp": "segundo"
},
{
"mDataProp": "vencimiento"
},
{
"mDataProp": "observaciones"
}
],
//Empieza
"aoColumnDefs": [{
"aTargets": [ 8 ],
"mData":8,
"mRender": function ( data, type, full ) {
return 'Ver';
}
}],
[/code]

Replies

  • allanallan Posts: 61,710Questions: 1Answers: 10,103 Site admin
    Not sure I quite understand I'm afraid. Is the link showing in the Editor editing page? it shouldn't be! Can you link use to a page showing the problem please?

    Allan
  • fotrinofotrino Posts: 1Questions: 0Answers: 0
    You should create a null mData, you cant use aoColumns and aoColumnsDef at the same time. The example below will let you create a link taking the data of "observaciones" or whaterver field you choose. Also you can use fnRowCallback to make a link out of some column data.

    [code]
    { "mData": null,
    "fnRender" : function(oObj) {
    return 'Ver';
    }
    }
    [/code]
  • roca_table1roca_table1 Posts: 4Questions: 0Answers: 0
    fotrino thanks a lot!!

    this code work!

    [code]
    {
    "mDataProp": null,
    "fnRender" : function(oObj)
    {
    return 'Ver';
    }
    }

    [/code]

    I am very grateful
  • roca_table1roca_table1 Posts: 4Questions: 0Answers: 0
    Now, how a can make a condition when the field is empty?

    Thanks in advance
  • roca_table1roca_table1 Posts: 4Questions: 0Answers: 0
    I solved the problem:

    [code]
    {
    "mDataProp": null,
    "fnRender" : function(oObj)
    {
    if (oObj.aData["url"] != '' ){
    return 'Ver'
    }
    else{
    return oObj.aData["url"]
    }
    }
    }
    [/code]


    Thanks a lot for you help!!
This discussion has been closed.