EasyUI Forum
September 15, 2025, 03:19:56 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: Show buttons for specific rows in datagrid  (Read 9992 times)
nprioleau
Newbie
*
Posts: 12


View Profile
« on: March 23, 2016, 04:20:26 AM »

I want to show a button in a datagrid row if the criteria is met. Please can someone explain how I can do this. It would mean iterating through the result before loading the data?
Logged
nprioleau
Newbie
*
Posts: 12


View Profile
« Reply #1 on: March 23, 2016, 05:15:08 AM »

I have managed. I first defined the column:

Code:
<th field="pur_received" width="20" formatter="showButton">Action</th>

And then rendered the button if the criteria was met.

Code:
function showButton(val,row){
for(var name in row){
if (row["pur_received"]=="Received")
{
} else {
var s = '<button class="easyui-linkbutton" iconCls="icon-edit" onclick="receive_goods(this)"></button> ';
return s;
}
}
}
Logged
jarry
Administrator
Hero Member
*****
Posts: 2298


View Profile Email
« Reply #2 on: March 23, 2016, 08:50:48 AM »

Please refer to http://www.jeasyui.com/forum/index.php?topic=5734.msg14673#msg14673
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!