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

Clicking Add in 2nd detail view enables update button in 1st detail view ??

When I have two details views expanded and I click Add in the Second one, the Update button in the First one gets enabled. When I press it there is no result and no error!

Can anyone shed any light on how to get around this fundemental issue?

3 Replies

PK Prasanna Kumar Viswanathan Syncfusion Team June 9, 2016 09:22 AM UTC

Hi Duncan, 

Thank you for contacting Syncfusion Support.   
  
The mentioned issue arises due to the same ID for the two detail views. So, we suggest that you mention unique Id for each detail view.   
  
Find the code example and sample:   


<script id="tabGridContents" type="text/x-jsrender"> 
             <div id="detailGrid{{:EmployeeID}}"> 
        </div> 
    </script> 
    <script type="text/javascript"> 
        $(function () { 
            $("#Grid").ejGrid({ 
                // the datasource "window.employeeView" is referred from jsondata.min.js 
                dataSource: ej.DataManager(window.employeeView).executeLocal(ej.Query().take(9)), 
                detailsTemplate: "#tabGridContents", 
                detailsDataBound: "detailGridData", 
                editSettings: { allowEditing: true, allowAdding: true, allowDeleting: true }, 
                toolbarSettings: { showToolbar: true, toolbarItems: [ej.Grid.ToolBarItems.Add, ej.Grid.ToolBarItems.Edit, ej.Grid.ToolBarItems.Delete, ej.Grid.ToolBarItems.Update, ej.Grid.ToolBarItems.Cancel] }, 
                columns: [ 
                         ------------------------------ 
               ] 
            }); 
        }); 
        function detailGridData(e) { 
            var filteredData = e.data["EmployeeID"]; 
            // the datasource "window.ordersView" is referred from jsondata.min.js 
            var data = ej.DataManager(window.ordersView).executeLocal(ej.Query().where("EmployeeID", "equal", parseInt(filteredData), true)); 
            e.detailsElement.find("#detailGrid" + filteredData).ejGrid({ 
                dataSource: data, 
                allowSelection: true, 
                allowPaging: true, 
                pageSettings : { pageSize : 2}, 
                editSettings: { allowEditing: true, allowAdding: true, allowDeleting: true }, 
                toolbarSettings: { showToolbar: true, toolbarItems: [ej.Grid.ToolBarItems.Add, ej.Grid.ToolBarItems.Edit, ej.Grid.ToolBarItems.Delete, ej.Grid.ToolBarItems.Update, ej.Grid.ToolBarItems.Cancel] }, 
                columns: [ 
                         -------------------------------- 
 
                ] 
            }); 
        } 
    </script> 


Regards, 
Prasanna Kumar N.S.V 
 



DU duncan June 15, 2016 08:03 AM UTC

Thanks for the advice I'll bear it in mind for future usage. I found a solution by creating 2 different prototypes for my grids in the end instead of trying to do everything in 1 prototype.


PK Prasanna Kumar Viswanathan Syncfusion Team June 16, 2016 05:36 AM UTC

Hi Duncan, 

We are happy to hear that your issue has been resolved. 

Please let us know if you need any further assistance. 

Regards, 
Prasanna Kumar N.S.V 


Loader.
Up arrow icon