Extjs AJAX语言Api
我们可以在EXTjs中使用google AJAX语言API吗????? 我试过翻译的例子,我有一个html文件 和typemarathi.jsExtjs AJAX语言Api,ajax,api,extjs,Ajax,Api,Extjs,我们可以在EXTjs中使用google AJAX语言API吗????? 我试过翻译的例子,我有一个html文件 和typemarathi.js google.load("elements", "1", { packages: "transliteration" }); function onLoad() { var options = { sourceLanguage: google.elements.transliteration.LanguageCode.ENGLI
google.load("elements", "1", { packages: "transliteration" });
function onLoad() {
var options = {
sourceLanguage: google.elements.transliteration.LanguageCode.ENGLISH,
destinationLanguage: [google.elements.transliteration.LanguageCode.MARATHI],
shortcutKey: 'ctrl+g',
transliterationEnabled: true
};
// Create an instance on TransliterationControl with the required
// options.
var control = new google.elements.transliteration.TransliterationControl(options);
// Enable transliteration in the editable DIV with id
// 'transliterateDiv'.
control.makeTransliteratable([myname]);
}
google.setOnLoadCallback(onLoad);
它很好用
但是如果我用extjs写textfield
Ext.onReady(function(){
var form1=new Ext.FormPanel({
renderTo:document.body,
frame:true,
title:'My First Form',
widyh:250,
items:[{ xtype:'textfield', fieldLabel:'First name', name:'firstname'}]
});
});
并尝试将firstname属性传递给control.makeTranslateratable[firstname],然后它就不起作用了。。。它说无效id错误
但如果我将->html textfield name传递给它的control.makeTranslateratable[myname],它就可以正常工作了
我想输入和显示多个非英语语言数据
在编程方面,我使用EXTjs的前端是否有其他方法可以做到这一点,如果有,请建议我。请 是的,你可以。
除此之外,有人应该清理代码,这很快。是的,你可以。但您应该知道,ExtJs会自动为html元素生成标识符:
html:
<div class="x-form-item x-form-label-left x-box-item" id="ext-gen27" style="left: 0px; top: 0px;">
<label style="width: 55px;" class="x-form-item-label" id="ext-gen28">Send To:</label>
<div style="padding-left: 60px; width: 668px;" class="x-form-element" id="ext-gen26">
<div class="x-form-field-wrap x-form-field-trigger-wrap x-trigger-wrap-focus" id="ext-gen24" style="width: 668px;">
<input type="text" name="to" id="ext-comp-1002" autocomplete="off" size="24" class=" x-form-text x-form-field x-form-focus" style="width: 651px;">
</div>
</div>
</div>
js:
....
items: [{
xtype: 'combo',
store: ['test@example.com', 'someone-else@example.com' ],
plugins: [ Ext.ux.FieldReplicator, Ext.ux.FieldLabeler ],
fieldLabel: 'Send To',
name: 'to'
}]
但请注意,只有在呈现所有元素后才应调用此函数。您还可以编写一个脚本,将此功能注入“render”方法。编写插件是一种更好但更难的方法。这是你一小时前问的同一个问题吗?
var control = new google.elements.transliteration.TransliterationControl(options);
var labelIds = [];
Ext.each(Ext.select('label'), function(item){
labelIds.push(item.id);
});
control.makeTransliteratable(labelIds);