In some projects, in order to facilitate the storage of certain values in the database as specified numbers, for example, in state, 1 is specified as allowed, 0 is specified as prohibited, but in the management interface with 1 and 0 display is not very good and ease of use, then how to deal with this situation?
The easiest way to do this is to add a judgment to the DataGrid when data is bound, as follows:
<script type= "Text/javascript" >
$ ("#dg"). DataGrid ({
columns:[[
{field: ' state ', title: ' Expand Status ', width:120,
formatter:function (value,row,index) {
if (value==1) {return
"allows the extension of"
}else{
return " No extension "}}}
,
]"]
The above is a small set of Jqueryeasyui to introduce the DataGrid data display, I hope to help you, if you have any questions please give me a message, small series will promptly reply to everyone. Here also thank you very much for the cloud Habitat Community website support!