troubleshooting Question

How do I access a column, or cell's data of my jQuery datatable?

Avatar of Michael Sterling
Michael SterlingFlag for United States of America asked on
.NET ProgrammingASP.NETC#jQueryAJAX
2 Comments1 Solution226 ViewsLast Modified:
I've got a jQuery datatable populated and have added a link in one of the columns to take the user to a different page for data processing. I need to pass the value of a particular column (cell) in the row. How do I do this? (see attatched code below)

        $(document).ready(function () {
            $.ajax({
                "url": "SignInGrid.aspx/getData",
                "type": "POST",
                "contentType": "application/json; charset=utf-8",
                "dataType": "json",
                "success": function (json) {
                    $('#example').DataTable({
                        "columns": [
                            {
                                "targets": 0,
                                "data": "DEALERID",
                                //"render": function (data, type, full, meta, oData) {
                                //    return '<a href="Contact.aspx?dealerid=' + data + '">' + data + '</a>';
                                "url": "Default.aspx/doLinkStuff"
                                //}
                            },
                            { "data": "EMAIL" },
                            { "data": "FIRSTNAME" },
                            { "data": "LASTNAME" },
                            { "data": "COMPANY" },
                            { "data": "CITY" },
                            { "data": "STATE" },
                            { "data": "ZIP" },
                            { "data": "BRANCH" },
                            {
                                "data": null,
                                "className": "center",
                                "render": function (data, type, full, meta, oData) {
                                    return '<a href="EditTimeRecord.aspx?timerecordid=' + data[0] +
                                    '&edit=y" class="editor_edit">Edit</a> / <a href="EditTimeRecord.aspx?timerecordid=' + data[0] +
                                    '&delete=y" class="editor_remove">Delete</a>'
                                }
                            }
                        ],
                        "aaData": $.parseJSON(json.d)
                    });
                }
            });
        });
ASKER CERTIFIED SOLUTION
Michael Sterling
Web Applications Developer

Our community of experts have been thoroughly vetted for their expertise and industry experience.

Join our community to see this answer!
Unlock 1 Answer and 2 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 2 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros