Webgrid 8 and cleint event

13 replies. Last post: September 23, 2012 11:57 AM by Bernard Xiang
Tags :
  • (None)
  • New Discussion
  • New Question
  • New Product Feedback
John BoninMember

I have the following client script that will expand or collapes a preview row when the users clicks anywhere on the row without requring the user to click the arrow.  Grid has the CellClickAction to RowSelect.

The code works except if the user happens to click on the arrow to expand/collapse the row, if the row is already expanded it will collapse it and then expand it, if it is collapsed it will open and then collaps it.

        function WebGrid1_OnRowSelect(controlId, tblName, rowIndex, rowEl) {
            var WebGrid1 = ISGetObject(controlId);
            var row = WebGrid1.GetSelectedObject().GetRowObject();

            if (row.Type == 'Record') {
                if (row.PreviewRowExpanded) {
                    row.CollapsePreviewRow();
                } else {
                    row.ExpandPreviewRow();
                };
            };
            WebGrid1.SetStatus1("", "Ready.", "CommonText/Ready")
            return true;
        }

 

Any suggestions?

Thanks

All times are GMT -5. The time now is 6:34 PM.
Previous Next