user595234
user595234

Reputation: 6259

EXTJS, how to escape special character?

In the EXTJS, how to escape special character ?

for example, compiler is complaining showDetail('{1}') , how to escape the '' ?

Thanks

 return Ext.String.format(
            '{0} <a href="#" onclick="showDetail('{1}');">detail</a>',
            value,            
            record.getReportId()            
        );

Upvotes: 0

Views: 2968

Answers (1)

Daniel A. White
Daniel A. White

Reputation: 190986

You should be able to use the standard \. Place it before ' like so \'.

    return Ext.String.format(
        '{0} <a href="#" onclick="showDetail(\'{1}\');">detail</a>',
        value,            
        record.getReportId()            
    );

Upvotes: 1

Related Questions