a simple datagrid formatter example

here’s a very simple datagrid formatter example:

1. use javascript:

{
field:’marktext’,title:’序号’,width:”30″,align:”center”,sortable:”true”,
formatter: function(value,row,index){
if(value!=null){
value = value.substr(0,1);
}
return value + (index+1);
}
}

2. use in html

<th field=”marktext” width=”30″ sortable=”true” align=”center”
data-options=”formatter:function(value,row,index){
if(value!=null){
value = value.substr(0,1);
}
return value + (index+1);
}”>序号</th>

This entry was posted in javascript. Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s