EasyUI Forum
March 28, 2024, 11:23:56 PM *
Welcome, Guest. Please login or register.

Login with username, password and session length
News:
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: DataGrid Colunm show hide  (Read 17201 times)
ehussain
Newbie
*
Posts: 16


View Profile Email
« on: May 11, 2014, 02:33:56 PM »

Is it possible to hide show columns programmatically?

ehussain.
Logged
stworthy
Administrator
Hero Member
*****
Posts: 3581


View Profile Email
« Reply #1 on: May 11, 2014, 06:24:08 PM »

Please call 'showColumn' or 'hideColumn' methods to display or hide a column.
Code:
$('#dg').datagrid('showColumn', 'itemid');  // show the column
$('#dg').datagrid('hideColumn', 'itemid');   // hide it again
Logged
ehussain
Newbie
*
Posts: 16


View Profile Email
« Reply #2 on: May 15, 2014, 02:26:15 AM »

One more thing..
how to set data type any integer value column in Grid?

thanks
Logged
arma
Full Member
***
Posts: 110


View Profile
« Reply #3 on: November 12, 2017, 09:29:25 PM »

Hi,

I have grid with header group represents a month with 2 columns each :
Code:
product  |       Jan    |       ...    |       Dec    |     Total    |
name     | Qty | Amount | Qty | Amount | Qty | Amount | Qty | Amount |
----------------------------------------------------------------------

When i hide All December columns :
Code:
$('#mydg').datagrid('hideColumn', 'qty_12');
$('#mydg').datagrid('hideColumn', 'amount_12');
Jeasui instead hide the Total Columns, and the December columns are still there. Is this considered a bug?
Logged
stworthy
Administrator
Hero Member
*****
Posts: 3581


View Profile Email
« Reply #4 on: November 13, 2017, 12:04:16 AM »

Make sure your field names are unique. This is the working example http://code.reloado.com/iziviv3/edit#javascript,html,live
Logged
arma
Full Member
***
Posts: 110


View Profile
« Reply #5 on: November 15, 2017, 03:42:04 PM »

Hi Stworthy,

I'm pretty sure i'm using unique name for each field. Well i have to recheck one by one again since in your example it works good.

Another thing is :
How could i make first column frozen in your example? Setting frozen property to true does not seems to give any difference.

Thanks.
« Last Edit: November 15, 2017, 04:37:33 PM by arma » Logged
stworthy
Administrator
Hero Member
*****
Posts: 3581


View Profile Email
« Reply #6 on: November 15, 2017, 08:30:05 PM »

Use the 'frozenColumns' property to define your frozen columns. Please look at this example

http://code.reloado.com/iziviv3/3/edit
Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines Valid XHTML 1.0! Valid CSS!