find hidden column value in a dynamacally bind html table with Sharepoint list - Javascript

I have following code. Now I want to get the hidden column value based on user selected row. I also want to highlight the entire row, not only the e.target.
Can someone please help me.

function getTermdetailsQuerySuccsess(sender, args) {

    var listEnumerator = Termsitems.getEnumerator();
    var datatable = document.getElementById("TermList");



    while (listEnumerator.moveNext()) {

        var oListItem = listEnumerator.get_current();

        //var firstName = listEnumerator.get_current().get_item('Title');
        //var secondName = listEnumerator.get_current().get_item('LastName');
        var termID = listEnumerator.get_current().get_item('ID');
        var startdate = listEnumerator.get_current().get_item('startdate');
        var enddate = listEnumerator.get_current().get_item('Enddate');
        var termtype = listEnumerator.get_current().get_item('TermType');
        var Hours = listEnumerator.get_current().get_item('Hours');
        var EdNone = listEnumerator.get_current().get_item('EdNoned');
        var Specialty = listEnumerator.get_current().get_item('Specialty');

        var Subspecialty = listEnumerator.get_current().get_item('Subspecialty');
        var Hospital = listEnumerator.get_current().get_item('Hospital');
        var DEMT = listEnumerator.get_current().get_item('DEMT');
        var Supervisor = listEnumerator.get_current().get_item('Supervisor');

        rowcount = rowcount + 1;
        $("#TermList").append("<tr style='border-bottom:1px silver solid' align='middle'  class='gradeA'>" +

                                  "<td align='left' style='display:none'>" + termID + "</td>" +

                                  "<td align='left'>" + startdate + "</td>" +

                                  "<td align='left'>" + enddate + "</td>" +

                                  "<td align='left'>" + termtype + "</td>" +

                                  "<td align='left'>" + Hours + "</td>" +

                                  "<td align='left'>" + EdNone + "</td>" +

                                  "<td align='left'>" + Specialty + "</td>" +

                                  "<td align='left'>" + Subspecialty + "</td>" +

                                  "<td align='left'>" + Hospital + "</td>" +

                                  "<td align='left'>" + DEMT + "</td>" +

                                  "<td align='left'>" + Supervisor + "</td>" +

                                  "</tr>");

    }

}

 $('#TermList').click(function (e) {
        var tr = $(e.target).parent().index() ;
        alert(tr);
        alert($(e.target).text()); // using jQuery
        //  var Cells = tr.e.getElementsByTagName("td");

        $(e.target).addClass('row-highlight');


        var confirmationM = confirm("Do you want to edit this term deatils ?");
        if (confirmationM == true) {
            confirmation = "You pressed OK!";
        }
        else {
            confirmation = "You pressed Cancel!";
            $(e.target).removeClass('row-highlight');
        }
    });


 $('#TermList').click(function (e) {
        var tr = $(e.target).parent().index() ;
        alert(tr);
        alert($(e.target).text()); // using jQuery
        //  var Cells = tr.e.getElementsByTagName("td");

        $(e.target).addClass('row-highlight');


        var table = $("#TermList")[0];
        var cell = table.rows[tr].cells[1];
        alert(cell);


        var confirmationM = confirm("Do you want to edit this term deatils ?");
        if (confirmationM == true) {
            confirmation = "You pressed OK!";
        }
        else {
            confirmation = "You pressed Cancel!";
            $(e.target).removeClass('row-highlight');
        }
    });		
January 17th, 2014 7:30pm

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics