User Profile & Activity

leo Chandra Member
Page
of 14
Posted: December 23, 2014 1:08 AM

Hi Spring gao,

You could use the following Javascript code to accomplish it. (run it when your button click).

function getCheckedValues(){
    // get WebGrid with ID. in this example I use WebGrid1
    var grd = wgGetGridById("WebGrid1");
    var table = grd.GetRootTable();

    //this is the point. get all checked row of your grid.
    var checkedRows = table.GetCheckedRows();
    var result = "";
    for (var i = 0; i < checkedRows.length; i++)
    {
        // append the needed value to result. in this example I use value in column index 3 and index 4.
        result += checkedRows[i].cells[3].innerText +"|"+ checkedRows[i].cells[4].innerText;
        result += ",";
    }
    // remove leading separator (,)
    result = result.replace(/,$/, "");
    // pass all to textarea/input for showing the result. In this example I used textarea tag with id:"textarea"
    document.getElementById("textarea").value = result;
}

That should do the trick.

All times are GMT -5. The time now is 9:36 PM.
Previous Next