EasyUI Forum
May 03, 2024, 01:19:45 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: changing datagrid column title  (Read 6774 times)
edus
Newbie
*
Posts: 4


View Profile Email
« on: June 12, 2014, 07:33:58 AM »

Hi , there is an option to retrieve the datagrid column title with getColumnOption, but how to change/update that propertie dinamicaly?

For example:
var col = $('#dg').datagrid('getColumnOption', field);
col.title = 'New Title'; - this does not work.

Thanks in advance.

Logged
jarry
Administrator
Hero Member
*****
Posts: 2262


View Profile Email
« Reply #1 on: June 12, 2014, 03:12:28 PM »

To update and apply column properties, you have to recreate datagrid with the new columns.
Code:
var dg = $('#dg');
var columns = dg.datagrid('options').columns;
columns[0][2].title = 'new title';  //change columns ...
dg.datagrid({columns:columns});  // recreate datagrid
« Last Edit: June 12, 2014, 03:15:03 PM by jarry » 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!