Integrating Google Transliteration with Datatables Editor inline editing
Integrating Google Transliteration with Datatables Editor inline editing
Harinandan
Posts: 4Questions: 2Answers: 0
Hi,
I'm using Google Transliteration (https://developers.google.com/transliterate/v1/getting_started). This requires to provide ID of text input to the transliterate API.
I want to use this with inline editing or editing entire row. Since IDs of text input is not created until editing is to be done, transliterate API raise exception. Any idea how these can work together?
Regards,
Harinandan
This discussion has been closed.
Answers
Very interesting - it would be great to see this working!
I would suggest not accessing Editor's fields by ID, but rather use the
field().val()
method (there are others as well such asval()
for multiple values).Regards,
Allan
Hi Allan,
What you have suggested is the right approach. However, it involves much effort. To get something working quickly, I had to do a hack.
If text field ID's are known, Google APIs handle transliteration themselves. On entering a space, they take english text, call API to transliterate and put back the transliterated output in place of the original text. Hence these are the steps I did to get transliteration working:
Now transliteration gets enabled on those text fields whose IDs were supplied.
Regards,
Harinandan
Got it - that's really nice.
Great to hear you've got this working!
Allan