EasyUI Forum

General Category => EasyUI for jQuery => Topic started by: nprioleau on March 23, 2016, 04:20:26 AM



Title: Show buttons for specific rows in datagrid
Post by: nprioleau 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?


Title: Re: Show buttons for specific rows in datagrid [SOLVED]
Post by: nprioleau 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;
}
}
}


Title: Re: Show buttons for specific rows in datagrid
Post by: jarry on March 23, 2016, 08:50:48 AM
Please refer to http://www.jeasyui.com/forum/index.php?topic=5734.msg14673#msg14673