1.更新tab
$('#tts').tabs('update', {
tab:$('#tts').tabs('getTab',1),
options: {
title:'记录 '+row.id,
href:root()+'/holds/get?id='+row.id
}
});
2.
@responsebody表示该方法的返回结果直接写入HTTP response body中 一般在异步获取数据时使用,在使用@RequestMapping后,返回值通常解析为跳转路径,加上@responsebody后返回结果不会被解析为跳转路径,而是直接写入HTTP response body中。比如异步获取json数据,加上@responsebody后,会直接返回json数据。3. 格式化
{
field:"location",
title:"77",
width:80,
sortable:true,
formatter:function(value,row,index){
if (value){
var result=$.ajax({type:'post',url:root()+"/tion.json",async:false});
$.each($.parseJSON(result.responseText),function(id,data){
if(data.id==value){
value = '<span title="'+data.code+' '+data.text+'">'+data.text+'</span>';
}
});
return value;
}
}
}
{
field:"created_date",
title:"日期",
width:50,
sortable:true,
formatter:dateformatter
}
{
field:"item.barcode",
title:"条码",
width:100,
formatter:function(value,row,index){
if(row.item.barcode){
return row.item.barcode;
}
}
}