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.
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

childGrid using sorting from main grid datamanager

Thread ID:

Created:

Updated:

Platform:

Replies:

124628 Jun 19,2016 06:46 PM Jun 21,2016 08:58 AM JavaScript 3
loading
Tags: ejGrid
David Barrett
Asked On June 19, 2016 06:46 PM

I am loading a grid with a url connector, and loading data for the child grid from another datamanager.

The loading is fine and I can pull up the correct child grids and page through the contents. 
My issue comes when someone clicks on the header row of the child grid and it tries to sort the child grid. When that happens it tries to use the sorting mechanism from the main grid and crashes. 
Also when someone dblclicks on a child row it returns an error becuase it is trying to edit the child row data. I am happy to have no sorting or editing capabilities on the child grid but none of the options I tried seemed to make a difference. I got the basic childGrid commands off of the javascript api on the website under heirarchical data but there is no mention there about sorting/editing and how to handle it or prevent it (if its on in main table) 

I have included the javascript that I am using to attempt this. 

Thanks for any help or information


<div class="col-lg-12 admin-area">
<div class="panel panel-default">
<div class="panel-heading"><h4 class="panel-title text-center">Districts</h4></div>
<div class="panel-body">
<p class="text-bold">Below are the current school districts in the system. </p>
<div id="griddists"></div>
</div>
</div>
</div>
<script type="text/javascript">
/* Setup Contacts Table and Editing */
var distdata = ej.DataManager({
   url:"assets/includes/functionsAJAX.php?mode=getDistricts",
insertUrl:"assets/includes/functionsAJAX.php?mode=addDistrict",
removeUrl:"assets/includes/functionsAJAX.php?mode=delDistrict",
updateUrl:"assets/includes/functionsAJAX.php?mode=updDistrict",
adaptor: new ej.UrlAdaptor()
});
var distchild = ej.DataManager({
   url:"assets/includes/functionsAJAX.php?mode=getSchDistricts",
adaptor: new ej.UrlAdaptor()
});
var distgrid = $("#griddists").ejGrid({
            dataSource: distdata,
allowPaging:true,
allowResizing:true,
allowSorting:true,
allowTextWrap:true,
isResponsive: true,
enableResponsiveRow: true,
enableAltRow:true,
enableHeaderHover:true,
enableRowHover:true,
enableTouch:false,
endAdd: function(){$("#griddists").ejGrid("refreshContent");},
endEdit: function(){$("#griddists").ejGrid("refreshContent");},
columns: [
                { field: "district_id", allowEditing:false, isIdentity:true, isPrimaryKey: true, headerText: "ID", width:75 },
                { field: "district_name", headerText: 'District Name', validationRules: { required: true, minlength: 2 } },
                { field: "district_number", headerText: 'Number', validationRules: { required: false } }
            ],
contextMenuSettings: { enableContextMenu: true},
editSettings: {allowEditing: true, allowAdding: true, allowDeleting: true, showDeleteConfirmDialog: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,
            ej.Grid.ToolBarItems.Search,
             ej.Grid.ToolBarItems.PrintGrid
           
            },
            childGrid: {
dataSource: distchild,
queryString: "district_id",
allowSorting: false,
allowPaging: true,
pageSettings:{pageSize: 5},
columns: [
{ field: "school_id", allowEditing:false, isIdentity:true, isPrimaryKey: true, headerText: 'ID', width:75},
{ field: "school_name", allowEditing:false, headerText: 'Name'},
{ field: "school_number", allowEditing:false, headerText: 'Code'}
]
}
        });
</script>

Seeni Sakthi Kumar Seeni Raj [Syncfusion]
Replied On June 20, 2016 11:55 AM

Hi David,  

We are able to reproduce the problem at our end after enabling the isResponive property to parent Grid. We don't have to respondive Grid support with childGrid. So we suggest to disable the isResposive property of parent Grid. 

Regards, 
Seeni Sakthi Kumar S. 


David Barrett
Replied On June 20, 2016 12:33 PM



Thanks for the information,

by chance is there any way to disable the sorting capabilities on the child table as that is what is causing the issue and I don't really need it for what this is being used for. Can I interrupt the clicks on those objects and drop the request? Do you know if there is a common naming for the child grid areas


Thanks for you help

Mani Sankar Durai [Syncfusion]
Replied On June 21, 2016 08:58 AM

Hi David 
 
We have logged the requirement as an issue and a support incident has been created under your account to track the status of this requirement. Please log on to our support website to check for further updates.  
  
 
 
Regards, 
Manisankar Durai 
 


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

;