mRender problem: unable to form link to folder contents
mRender problem: unable to form link to folder contents
Allan, I'm having a problem using nRender and I'm not sure what I am missing since I have used this property before and it worked perfectly. I am obviously missing something critical. Here is a link to the page where the problem occurs
www.paulandkirk.com/Debolt/data/ClientPages/DataTables/DataTables-1.10.4/extensions/Editor-1.3.3/examples/inline-editing/ClientInventory_join.html
Here the Product names are highlighted but when you hover the url shows the .pdf file is undefined.
This same approach works well on the following link
www.paulandkirk.com/Debolt/data/ClientPages/DataTables/masterInventory.html
Here is the code on the problem page:
www.paulandkirk.com/Debolt/data/ClientPages/DataTables/DataTables-1.10.4/extensions/Editor-1.3.3/examples/inline-editing/ClientInventory_join.html
Here is the code on the page causing the problem:
www.paulandkirk.com/Debolt/data/ClientPages/DataTables/DataTables-1.10.4/extensions/Editor-1.3.3/examples/inline-editing/ClientInventory_join.html
Note
The 2nd return statement in mRender is commented out as it refers to the location on my laptop.
When the page loads choose page 6 to get past those entries that are "null". The null entries are the result of deletions in some of the other tables referred to in the join.
'''
Replies
Allan here is the code from the problem pag
'''
<!DOCTYPE html>
<html>
<head>
var editor; // use a global for the submit and return data rendering in the examples
$(document).ready(function() {
} );
</head>
<body class="dt-ClientInventoryJoin">
<a class="" href="#" style="position: relative;
text-decoration: none;
float: right; /* Added float-right /
display: inline-block;
margin-right: 3em; /Changed from 3px to 3em /
padding: 5px 8px;
border: 1px solid #c1c1c1;
cursor: pointer;
/cursor: hand;*/
font-size: 0.88em;
color: black !important;
</body>
</html>
Hi,
From the code you are trying to access the data as an array (
full[0]
), but the data is in object form, not an array. So you probably want something likefull. product_name.pdffilename
.Allan
Thanks, that was the answer.
I read the information on ColumnDefs and mRender but I didn't pick up any clues as to how to solve the problem. I was not sure what was wrong since the full[0] was working on my other page as the example showed it would. I was assuming it would read the data from the column with index 0 and apply the information in the cell to the link in column index 1. This is the scenario that runs on my other page.
You must have been using arrays as a data source for your other table. This manual page might be useful.
full
is the original data source object for the row though. It is not an array if you use an object for the row, which you are in this case.I'll make some changes to the documentation to improve the description of that in the
columns.render
option.Allan