2012-12-06 24 views
0

的SmartClient支持我有以下的SmartClient JS代碼,不渲染UTF-8字符在恰當UI爲UTF-8字符

function getGridLoadedWithDatasource(DS, DSfields) { 

var statGrid = isc.ListGrid.create({ 
    ID: "statusGrid", 
    autoFetchData: true, 
    fields: DSfields, 
    dataSource: DS, 
    canEdit: false, 
    autoDraw: true, 


    showRecordComponents: true,  
    showRecordComponentsByCell: true, 

    createRecordComponent : function (record, colNum) { 
           var fieldName = this.getFieldName(colNum); 
           if (fieldName == "btnClaim" && record["PTicketname"]=='Reklamacija') { 
            var button = isc.IButton.create({ 
             height: 18, 
             width: 65, 
             //icon: "flags/16/" + record["countryCode"] + ".png", 
             title: "Žalba", 
             click : function() { 
              //alert("Hello man!"); 
              isc.say("Need to draw a form here"); 
              //getInvoiceDetailWindow(record["rednibr"],tech, ba_id); 

             } 
            }); 
            return button; 
           } 
          } 
}); 
return statGrid; 

} 

,我使用的標題對UI得到打破這個詞。如何以及在哪裏爲smartclient小部件啓用/配置UTF-8?

最好的問候!

回答

2

如果您在JavaScript代碼中使用特殊字符作爲文字你必須確保JavaScript源代碼具有相同的字符編碼您的主頁。例如,在Notepad ++中,您應該使用菜單「Encoding/UTF-8 without BOM」或類似的命令將其設置爲UTF-8。

+0

我很確定這不是錯誤。不過,我用Sublime Text編輯器將遠程​​文件轉換爲UTF-8編碼文件,結果證明它工作正常。 – Zec