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

ejGrid javascript gridObj.hideColumns("Id");

Thread ID:





127715 Dec 5,2016 06:06 AM UTC Dec 6,2016 11:24 AM UTC JavaScript 1
Tags: ejGrid
Stephen Harris
Asked On December 5, 2016 06:06 AM UTC

I am trying to hide a column in an ejGrid using javascript. The best I can get is that it actually hides the Id column and itdoes show the remaining columns names but it does not render the data. It informs that there are 40 records but displays none. The hide column function is being called on the actionComplete event of the ejGrid:actionComplete: "ActionComplete". This runs he following function:
function ActionComplete(args) {
var gridObj = $("#Grid").ejGrid("instance");
if (args.requestType == "refresh") {
Also, it takes several seconds before it finishes the above, incomplete, process. When I run the grid load process without trying to hide the Id column it takes about a second. The grid is being loaded via a datamanager. I am using Syncfusion.EJ version14.3450.0.52. Any ideas?

Jayaprakash Kamaraj [Syncfusion]
Replied On December 6, 2016 11:24 AM UTC

Hi Stephen, 

Thank you for contacting Syncfusion support. 
In Grid, we have called refreshContent() in hideColumns method. So, the grid will be refreshed again and also actionComplete event will be triggered with requestType as refresh. To overcome this problem we suggest you to set flag variable and perform the action accordingly. Please refer to the below code example and sample. 

var flag = true; 
        $(function () { 
               actionComplete : function(args){ 
                           var gridObj = $("#Grid").ejGrid("instance"); 
if (args.requestType == "refresh" && flag == true) { 
flag = false; 
                editSettings: { allowEditing: true, allowAdding: true, allowDeleting: true, editMode: "batch" }, 
                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: [ 
                         { field: "OrderID", isPrimaryKey: true, headerText: "Order ID", textAlign: ej.TextAlign.Right, validationRules: { required: true, number: true }, width: 90 }, 
..                ] 


Jayaprakash K. 


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.

Please sign in to access our forum

or the page will be automatically redirected to sign-in page in 10 seconds.

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