def s3_datatable_truncate(string, maxlength=40):
 string = s3_unicode(string)
 if (string and (len(string) > maxlength)):
  _class = 'dt-truncate'
  return TAG[''](DIV(SPAN(_class='ui-icon ui-icon-zoomin', _style='float:right'), (string[:(maxlength - 3)] + '...'), _class=_class), DIV(SPAN(_class='ui-icon ui-icon-zoomout', _style='float:right'), string, _style='display:none', _class=_class))
 else:
  return (string if string else '')

def s3_datatable_truncate ( string , maxlength = 40 ) : string = s3_unicode ( string ) if ( string and ( len ( string ) > maxlength ) ) : _class = 'dt-truncate' return TAG [ '' ] ( DIV ( SPAN ( _class = 'ui-icon ui-icon-zoomin' , _style = 'float:right' ) , ( string [ : ( maxlength - 3 ) ] + '...' ) , _class = _class ) , DIV ( SPAN ( _class = 'ui-icon ui-icon-zoomout' , _style = 'float:right' ) , string , _style = 'display:none' , _class = _class ) ) else : return ( string if string else '' )
representation method to override the datatables-internal truncation of strings per field .