Get KeyValue when webgrid mode is group by (GroupHeader)

1 reply. Last post: February 25, 2016 9:15 AM by Yudi
Tags :
  • New Discussion
  • New Question
  • New Product Feedback
Sachin JainMember

Hi,

I went through your documentation for getting keyvalue when we do wedbgrid in groupby mode.

https://www.intersoftsolutions.com/Support/WebGrid/Documentation/topic495.html

function GetCellText()
{
    var grid = ISGetObject("WebGrid1");
    var curSelObj = grid.GetSelectedObject(); // get selected object

    if (curSelObj == null)
    {
        alert("No row selected. Please select a row");
    }
    else
    {
        var row = curSelObj.GetRowObject(); // get the WebGridRow object

        if (row.Type == "GroupHeader")
        {
            alert("Currently selected row is a Group Row. There is no cell information.");
        }
        else if (row.Type == "Record")
        {
            var cells = row.GetCells(); // obtain WebGridCellCollection of the specified row.
            var addressCell = cells.GetNamedItem("Address"); // get the address' WebGridCell object by name.

            alert("Current selected row's Address cell has this text : " + addressCell.Text + "\nThe cell's value is : " + (addressCell.Value == null ? "No Value" : addressCell.Value));
        }
    }
}

on the above method you have clearly mentoined when record type is GroupHeader then "Currently selected row is a Group Row. There is no cell information".

I need KeyValue when webgrid is in Group by mode on OnCellClick(controlId, tblName, rowIdx, cellIdx, cellElm) event.

I am able to get keyvalue when grid is NOT IN group by mode as bellow:

var WebRow = WebGrid1.RootTable.GetRow(rowIdx);

if (WebRow != null)
{
    if ((ColumnName == "XYZ") && rowIdx != -1)
    {
        if ((browserDocumentMode >= 11 && cellElm.childElementCount > 0) || (browserDocumentMode < 11 && cellElm.all.length > 0))
        {
            openDetails(WebRow.KeyValue);
        }
    }
}

Please reply ASAP.


Regards

Sachin Jain

All times are GMT -5. The time now is 11:31 AM.
Previous Next