I have found the answer to my question now.
It turns out I just needed to change:
var question = grid.getItem(e.rowIndex).question;
to:
var question = grid.store.getValue(grid.getItem(e.rowIndex), 'question');
Embark on a journey of knowledge! Take the quiz and earn valuable credits.
Take A QuizChallenge yourself and boost your learning! Start the quiz now to earn credits.
Take A QuizUnlock your potential! Begin the quiz, answer questions, and accumulate credits along the way.
Take A QuizGeneral Tech Learning Aids/Tools 3 years ago
User submissions are the sole responsibility of contributors, with TuteeHUB disclaiming liability for accuracy, copyrights, or consequences of use; content is for informational purposes only and not professional advice.
No matter what stage you're at in your education or career, TuteeHUB will help you reach the next level that you're aiming for. Simply,Choose a subject/topic and get started in self-paced practice sessions to improve your knowledge and scores.
Ready to take your education and career to the next level? Register today and join our growing community of learners and professionals.
Your experience on this site will be improved by allowing cookies. Read Cookie Policy
Your experience on this site will be improved by allowing cookies. Read Cookie Policy
manpreet
Best Answer
3 years ago
I am using the Dojo Toolkit to build an SRS to both aid in my learning of both the Dojo Toolkit and the Japanese language.
For those of your who don't know an SRS is basically a flash card system.
So, I have a side bar where I can choose a deck of cards to review and when I click on a deck from the list it opens up a new tab in a
TabContainerwhich contains twoContentPanes.One
ContentPanecontains aDataGridwhich currently uses anItemFileWriteStorewith aurlto ajsonfile.The
jsonfile contains the items for theDataGridwith each item possesing anid,questionandanswer.The
idis currently just anintegervalue and thequestionandanswerboth contain Japanese strings.The idea is that when a row in the
DataGridis clicked, theContentPanebelow the one containing theDataGridshould have it's contents replaced with adijit.Editor.The original contents of the
ContentPanebefore they are replaced is just a simple string sayingClick on the rows in the grid above to edit a card's details.I am creating the
dijit.Editorprogrammatically and everything works well until I try to give it a Japanese string from theDataGrid's row.This is my JavaScript which gets the
DataGridrow's information and creates thedijit.Editor:(
gridis theDataGridobject andcard_detailsis theidof theContentPane)The code above creates the
dijit.Editorin theContentPanebut doesn't fill it with the value stored in thequestionvariable (I have logged and alerted the variable and it does contain the expected value).However if I replace the variable with a literal string like
My Stringor even something in Japanese like反乱者it works just fine.It even works if I replace:
var question = grid.getItem(e.rowIndex).question;with:var question = '反乱者';Does anybody know why it won't work when using the
questionvariable when it has been assigned it's value viagrid.getItem(e.rowIndex).question?I am still a beginner when it comes to Dojo Toolkit so I'm sure it must be something obvious.
Any help would be appreciated!