Copy Code code as follows:
columns:[[
{field: "Activitycontent", Title: ' Active 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 several of the same places, activitycontent and 0.18 to be the same as the parameter ratio 11.5 Everyone can test their own adjustments, I'm here for the Chinese character rounding
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