EasyUI Forum
March 29, 2024, 07:45:44 AM *
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 column title  (Read 21927 times)
Xiaolin
Newbie
*
Posts: 14


View Profile Email
« on: July 24, 2011, 08:59:21 AM »

How can we get the datagrid column title? For example:
<table class="easyui-datagrid">
    <thead>
        <tr>
            <th field="Name" width="60">Name</th>
            <th field="Sex" width="35">Sex</th>
        </tr>
    </thead>
</table>
How can we get the "Name" and "Sex" text? Thanks in advance.
Logged
stworthy
Administrator
Hero Member
*****
Posts: 3581


View Profile Email
« Reply #1 on: July 24, 2011, 06:09:35 PM »

var fieldName = 'Name'; // the field name
var opts = $('#tt').datagrid('getColumnOption',fieldName);  // get the specified column option
alert(opts.title);  // the title to display
Logged
Xiaolin
Newbie
*
Posts: 14


View Profile Email
« Reply #2 on: July 25, 2011, 06:48:53 AM »

Got it, thank you very much!
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!