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. (Last updated on : Nov 16th 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Context Menu in child grids

Thread ID:

Created:

Updated:

Platform:

Replies:

122050 Feb 11,2016 06:05 PM UTC Feb 12,2016 12:03 PM UTC ASP.NET Web Forms 1
loading
Tags: Grid
Jorge Pampin
Asked On February 11, 2016 06:05 PM UTC

Hello,

I have this code to generate child grids, but the context menu only works with the first child grid that is expanded:

function detailGridDataDimensionesCOFs(e)
{
var data = e.data.CuentasDimensionesCOFRows;

var idControl = e.model.clientId.replace("_ctl01_GdcCOFsDimensiones", "");

idControl = idControl + "_ctl00_HFColumnasAsignaciones";
var result = document.getElementById(idControl).value;
var Columnas = JSON.parse(result);

var CM = [];
if (COSoloLectura())
{
CM = [TextoEDITARFORMULAS, TextoVERASIGNACION] ;
} else {
CM = [TextoEDITARFORMULAS, TextoVERASIGNACION, TextoELIMINARESTEIMPACTO, TextoELIMINARTODASLASFORMULASDELIMPACTO, TextoRECUPERARFORMULASORIGINALES];
}

var g = e.detailsElement.find("#detailDimensionesCOFs").ejGrid({
dataSource: data,
locale: GetLocale(),
allowSelection: true,
columns: Columnas,
editSettings: { allowAdding: false, allowEditing: false },
contextMenuSettings: { enableContextMenu: true, contextMenuItems: [], customContextMenuItems: CM },
contextClick: 'contextClick_detailDimensionesCOFs',
queryCellInfo: function (args) { GdcCOFsDimensionesAsignaciones_QueryCellInfo(args); },
toolbarSettings: { showToolbar: false },
allowResizeToFit: true,
idPadre:e.model.clientId
});
}

Thanks!

Ragavee U S [Syncfusion]
Replied On February 12, 2016 12:03 PM UTC

Hi Jorge,

Thanks for contacting Syncfusion Support.

Since all expanded detail Grid have same id, the reported issue has occurred. So we suggest you to define the detail Grid with unique id to resolve the issue. Please refer to the below code example.

<script id="GridContents" type="text/x-jsrender">       

            <div id="detailGrid{{:EmployeeID}}"></div><%--defining the element id with unique EmployeeID value.--%>       
    </script>

<script type="text/javascript">

       function detailGridData(e) {

            var filteredData = e.data["EmployeeID"];

           . . . .

//rendering the Grid control by finding the unique ID

            e.detailsElement.find("#detailGrid"+filteredData).ejGrid({

                . . . .

           });           

        }
    </script>


Also, from your code snippets, we found that you have explicitly modified the clientid and passed it to the detail grid model using “idPadre”. Since we don’t have any such property in grid, this wont affect the element id of the Grid.

For your convenience, we have created a sample which can be downloaded from the below location.

Sample Link: http://www.syncfusion.com/downloads/support/forum/122050/ze/Sample80693589

Regards,
Ragavee U S.

CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

;