columns:[[
{field:"activitycontent",title :'Activity content',width:fixWidth(0.18),align:"center",halign:"center",
formatter:function(value,rec){
if(value.indexOf("src") <0){
if(rec.activitycontent.length>Math.ceil(document.documentElement.clientWidth * 0.18)/11.5)
return rec.activitycontent.substring(0,Math.ceil(document.documentElement .clientWidth * 0.18/11.5)) '..';
else
return rec.activitycontent.substring(0,Math.ceil(document.documentElement.clientWidth * 0.18/11.5));
}
}
},
{..}
]]
Note that there are several similarities among them. Activitycontent and 0.18 have the same parameter ratio of 11.5. You can test and adjust it yourself. , I use it here to round Chinese characters
If the text content is greater than that length, the result is
Test length 8 Test length 74 test..
Otherwise it is
Test length 8 Test length 74 test