Javascript Error While retaining Expanded group row state with more records.

12 replies. Last post: July 5, 2012 9:50 PM by Handy Surya
Tags :
  • (None)
  • New Discussion
  • New Question
  • New Product Feedback
Madhavan GMember

Hi All,

Say I have 200 records in a grid.We are having logic of retaining the Expanded Grouped rows.

This javascript error is coming 

See attachment

Step 1.gridwith200rows.JPG

Step2:GroupingDoneon acloumn.JPG

step3:Expandedthe Group.JPG

step4:Clickingonrefreshbutton.JPG

step5:Javascript error when tried to retain the expanded grouped mode.JPG

 

Settings is

PagingMode="VirtualLoad" and VirtualLoadMode="Default"

 

Please advice.It is very urgent.

 

Regards,

Madhavan

 

Code used to retain the expand or collapse group state is:

var expandedGroupNodes;
  
  function WebGrid1_OnGroupExpand(controlId, tblName, groupIndex, rowPosition, rowIndex)
  {
   var WebGrid1 = ISGetObject(controlId);
   StoreExpandedGroupNode(rowPosition);
   return true;
  }
  
  function WebGrid1_OnGroupCollapse(controlId, tblName, groupIndex, rowPosition, rowIndex)
  {
   var WebGrid1 = ISGetObject(controlId);
   var splitResult = expandedGroupNodes.split(";");
   
   for (var i = 0; i < splitResult.length; i++)
   {
       var expandedGroupNodeTemp;
      
       if (splitResult[i] != rowPosition)
       {
           if (expandedGroupNodeTemp == null)
               expandedGroupNodeTemp = splitResult[i];
           else
               expandedGroupNodeTemp = expandedGroupNodeTemp + ";" + splitResult[i];
       }
   }
   
   expandedGroupNodes = expandedGroupNodeTemp;
   
   return true;
  }
  
  function StoreExpandedGroupNode(nodePosition)
  {
      if (expandedGroupNodes == null)
          expandedGroupNodes = nodePosition;
      else
          expandedGroupNodes = expandedGroupNodes + ";" + nodePosition;
     
      return expandedGroupNodes;
  }
  
  function WebGrid1_OnAfterResponseProcess(controlId, actionName, lastRequestObject, xmlResponseObject)
  {
   var WebGrid1 = ISGetObject(controlId);
   
   if (actionName == "Refresh")
   {
          if (expandedGroupNodes != null)
          {
              var splitResult = expandedGroupNodes.split(";");
              for (var i = 0; i < splitResult.length; i++)
                  WebGrid1.RootTable.GetRowByGroup(0, splitResult[i]).ExpandGroupRow();
          }
   }
   return true;
  }

 

All times are GMT -5. The time now is 12:47 AM.
Previous Next