EasyUI Forum
May 16, 2024, 04:45:20 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: how to set datagrid row header?  (Read 13645 times)
klynix
Newbie
*
Posts: 14


View Profile Email
« on: November 13, 2013, 08:33:14 PM »

hi
I wonder does anyone did row header for datagrid before?
mind to give some example on decorate it?
Logged
yupengfei
Newbie
*
Posts: 10


View Profile
« Reply #1 on: November 14, 2013, 07:56:28 PM »

Do you want to dynamically setting?
Logged
klynix
Newbie
*
Posts: 14


View Profile Email
« Reply #2 on: November 14, 2013, 08:17:05 PM »

I don't find any example of setting it.
If you could provide both, will be very much appreciate it.
Logged
yupengfei
Newbie
*
Posts: 10


View Profile
« Reply #3 on: November 14, 2013, 08:50:21 PM »

two ways:
1: using java
columns:[[
   <c:forEach items="${columns}" var="column" varSstatus="i">
   <c:if test="${i>0}">
              {field:"${column.field}", title:"${column.title}", width:90, sortable:false} ${i==columns.size()-1?"":","}
   </c:if>
   </c:forEach >
]]

2:using javascript
$.post('${createLink(action:"build Columns url ")}', params, function(data){
   var columns = [];
   var col = [];
   for(var i=0; i< data.length; i++){
      var v = data;
      var c = {title:v.title, field:v.field, width:90};
      col.push(c);
   }
   columns[0] = col;
   $('#datagrid').datagrid({columns:columns});
},"json");

I hope it can help you。


Logged
klynix
Newbie
*
Posts: 14


View Profile Email
« Reply #4 on: November 14, 2013, 09:07:17 PM »

any idea of using php?
i am not familir with javascript yet. but why do i need post at the begining?
Logged
yupengfei
Newbie
*
Posts: 10


View Profile
« Reply #5 on: November 14, 2013, 09:51:34 PM »

this's a Dynamic Mode.  Can  you post your code right now ?
« Last Edit: November 14, 2013, 09:53:05 PM by yupengfei » Logged
klynix
Newbie
*
Posts: 14


View Profile Email
« Reply #6 on: November 14, 2013, 10:28:49 PM »

honestly, i have no code at the moment cause i have no idea how it to be done.
but i did plot in excel for my example. which i snap in the picture.

first i need a list of user(header of each row). Then, i need a list of apps(header of each column).
then i am plotting the data among each cell for individual user vs apps for each privilege.
« Last Edit: November 15, 2013, 12:10:50 AM by klynix » Logged
yupengfei
Newbie
*
Posts: 10


View Profile
« Reply #7 on: November 15, 2013, 12:25:43 AM »

I see.

http://www.jeasyui.com/demo/main/index.php?plugin=DataGrid&theme=default&dir=ltr&pitem=
click on the link 'Frozen Columns in DataGrid'
« Last Edit: November 15, 2013, 12:33:05 AM by yupengfei » Logged
klynix
Newbie
*
Posts: 14


View Profile Email
« Reply #8 on: November 15, 2013, 12:45:58 AM »

thx a lot for your effort on helping. i will try figure it out.
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!