Gettin "/> pritned out if any fnredner target is 0

Gettin "/> pritned out if any fnredner target is 0

handbuchhandbuch Posts: 55Questions: 0Answers: 0
edited October 2010 in General
Hello Allan.

I may got a bug, i hope not but it looks like that.

So first, here is my JSON: http://pastebin.com/x36nQLdZ
Here is my HTML Stuff for the Table: http://pastebin.com/LG8kaJXg
Here is my Code: http://pastebin.com/uV0RdZ9T ---->> http://yfrog.com/0s28981526p

So it works perfectly rendering the checkbox. :) Everythign worked fine, then i wanted a column at the end with an symbol to edit, since i didnt know how to do a column which has no provided data by the json string (a column just for the edit icon) i just took the alcohol column.

So now, i got 2 frRenders. If the Target fo any of these is set to 0, i get "/> printed out next to the one which is NOT indexed with 0.

Replies

  • handbuchhandbuch Posts: 55Questions: 0Answers: 0
    edited October 2010
    Hmm its not bug, i just use the Obj.aData[0] again and at this poitn i already wrote the above input stuff into it, so, how can i ad 2 targets on 2 diffrent fnrender?

    Or how can i call the ID Tag of the input which i rendered before? like, Obj.aData[0].ID or some html tag.
  • handbuchhandbuch Posts: 55Questions: 0Answers: 0
    I now just added the id again to my json string and made a new column. But how do i get the value of value now? I dont g et it with fnnodes. serialize.

    [code] tblDrinks = $("#tblDrinks").dataTable( {
    "bPaginate": false,
    "bRetrieve": true,
    "sAjaxSource": "files/scripts/GetJSON_Drinks.php",
    "aoColumnDefs": [{
    "fnRender": function ( oObj ) {
    return '';
    },
    "aTargets": [ 0 ]
    },{
    "fnRender": function ( oObj ) {
    return '';
    },
    "aTargets": [ 10 ]
    }]
    });[/code]
  • allanallan Posts: 63,498Questions: 1Answers: 10,471 Site admin
    So the problem is that you want to use aData[0] again in the second fnRender, but DataTables has altered what aData is? Have a look at bUseRendered: http://datatables.net/usage/columns#bUseRendered . Set it to false and DataTables will leave aData as it is, but display your HTML in the table.

    Allan
This discussion has been closed.