Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
45
Hierachical Grid Check All or Uncheck All...
posted

Hi ALL

Help Me Please, how can I add a Recursive Function for check/uncheck all checkbox in the ClientSideEvents "AfterCellUpdateHandler". My grid is Hierarchical (n layer) and each level has a checkbox.

I am using ultrawebgrid 2009.1 with asp.net 3.5

 

Parents
  • 334
    Verified Answer
    posted

    Hi,

    Try to use this javacritpt code:

    function AfterCellUpdate(gridName,cellID)
            {
                var cell = igtbl_getCellById(cellID)
                if (cell)
                {
                    var parentValue = cell.getValue();
                    var children = cell.Row.getChildRows();
                    if (children && cell.Column.ColumnType == 3)
                    {
                        for (var i = 0; i < children.length; i++)
                        {
                            var row = igtbl_getRowById(children[i].id);
                            if (row)
                            {
                                var childCell = row.getCellFromKey('COLUMNKEY')
                                if (childCell)
                                {
                                    childCell.setValue(parentValue);
                                }
                            }
                        }
                    }
                }
            } 

    And on uwg's propertie ClienteSideEvents set this:

    <ClientSideEvents AfterCellUpdateHandler="AfterCellUpdate" />

    I hope this hepful.

Reply Children
No Data