views:

92

answers:

4

can we use google AJAX Language API with EXTjs????? i have tried example for translitration i have one html file New Document

Type in Hindi (Press Ctrl+g to toggle between English and Hindi)

and typemarathi.js

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);

it works fine.

but if i write the textfield in extjs

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'

                }
            ]

});

});

and try to pass firstname (name attribute to control.makeTransliteratable([firstname])) then it does not work... it says invalid id error

but if i pass->(html textfiled name to it) control.makeTransliteratable([myname]) it works fine

+4  A: 

Yes we can!

flybywire
+1  A: 

I don't see why you would not be able to -- actually, I'm pretty sure you can, like you can use it with other frameworks, like jQuery or Prototype.

(Did you run into any kind of specific trouble ? If so, you might want to edit your question, to provide us with more details)

Pascal MARTIN
+1  A: 

YES YOU CAN!

streetparade
duplicate :) http://stackoverflow.com/questions/2333826/extjs-with-google-ajax-language-api/2333841#2333841
flybywire
A: 

It's unclear to me based on your code, but if you are passing the string value 'firstname' (with quotes) to the Google lib, then it should work fine I would assume. However, if you are passing an object reference (which it looks like in your example) then you would have to pass the underlying field reference, not the Ext TextField object reference (like myTextField.getEl()).

bmoeskau