We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

very urgent How to reopen grid view any row programtically

I want to repoopen grid any specific row from jquery.

for example I want to reopen grid third row programtically 

1 Reply

PK Prasanna Kumar Viswanathan Syncfusion Team October 15, 2015 07:07 AM UTC

Hi Bharat,

Thanks for using Syncfusion products.

Query : “I want to reopen grid any specific row from jquery.

If you need to reopen the child grid for the specific row, we suggest you to use expandcollapse function in the create client side event. Create event triggered when the grid is rendered completely.

Please find the code example and sample.

$("#Grid").ejGrid({
                dataSource: data,

                allowSorting: true,
                create :"onCreate",
                columns: [
                       { field: "EmployeeID", headerText: 'Employee ID', textAlign: ej.TextAlign.Right, width: 75 },
                       { field: "FirstName", headerText: 'First Name', textAlign: ej.TextAlign.Left, width: 100 },
                       { field: "Title", headerText: 'Title', textAlign: ej.TextAlign.Left, width: 120 },
                       { field: "City", headerText: 'City', textAlign: ej.TextAlign.Left, width: 100 },
                       { field: "Country", headerText: 'Country', textAlign: ej.TextAlign.Left, width: 100 }
                ],
                childGrid: {
                    dataSource: dataManger,
                    queryString: "EmployeeID",
                    allowPaging: true,
                    columns: [
                      { field: "OrderID", headerText: 'Order ID', textAlign: ej.TextAlign.Right, width: 75 },
                      { field: "ShipCity", headerText: 'Ship City', textAlign: ej.TextAlign.Left, width: 100 },
                      { field: "Freight", headerText: 'Freight', textAlign: ej.TextAlign.Left, width: 120 },
                      { field: "ShipName", headerText: 'Ship Name', textAlign: ej.TextAlign.Left, width: 100 }
                    ],
                    childGrid: {
                        dataSource: dataManger2,
                        queryString: "CustomerID",
                        columns: [
                             { field: "CustomerID", headerText: 'Customer ID', textAlign: ej.TextAlign.Right, width: 75 },
                             { field: "Phone", headerText: 'Phone', textAlign: ej.TextAlign.Left, width: 100 },
                             { field: "Address", headerText: 'Address', textAlign: ej.TextAlign.Left, width: 120 },
                             { field: "Country", headerText: 'Country', textAlign: ej.TextAlign.Left, width: 100 }
                        ],
                    },

                },

            });
        });
     
      function onCreate(args) {
            var detailRow = this.element.find(".e-detailrowcollapse").eq(3);
            this.expandCollapse(detailRow);
        }

                                                                              

Sample Link :  http://jsplayground.syncfusion.com/vt4pqknm

Please refer to the following UG Documentation for create event,

http://help.syncfusion.com/js/api/ejgrid#events:create

If we misunderstood your requirement, Please confirm the following details.

1.       Share what type of grid you are using whether Detail Template or Hierarchy Grid?

2.       Do you need to reopen the child grid from the specific row?

3.       Provide a screenshot of an requirement.

Regards,
Prasanna Kumar N.S.V


Loader.
Live Chat Icon For mobile
Up arrow icon