Speak now
Please Wait Image Converting Into Text...
Embark on a journey of knowledge! Take the quiz and earn valuable credits.
Challenge yourself and boost your learning! Start the quiz now to earn credits.
Unlock your potential! Begin the quiz, answer questions, and accumulate credits along the way.
General Tech Learning Aids/Tools 2 years ago
Posted on 16 Aug 2022, this text provides information on Learning Aids/Tools related to General Tech. Please note that while accuracy is prioritized, the data presented might not be entirely correct or up-to-date. This information is offered for general knowledge and informational purposes only, and should not be considered as a substitute for professional advice.
Turn Your Knowledge into Earnings.
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 TabContainer which contains two ContentPanes.
TabContainer
ContentPane
One ContentPane contains a DataGrid which currently uses an ItemFileWriteStore with a url to a json file.
DataGrid
ItemFileWriteStore
url
json
The json file contains the items for the DataGrid with each item possesing an id, question and answer.
id
question
answer
The id is currently just an integer value and the question and answer both contain Japanese strings.
integer
The idea is that when a row in the DataGrid is clicked, the ContentPane below the one containing the DataGrid should have it's contents replaced with a dijit.Editor.
dijit.Editor
The original contents of the ContentPane before they are replaced is just a simple string saying Click on the rows in the grid above to edit a card's details.
Click on the rows in the grid above to edit a card's details
I am creating the dijit.Editor programmatically and everything works well until I try to give it a Japanese string from the DataGrid's row.
This is my JavaScript which gets the DataGrid row's information and creates the dijit.Editor:
(grid is the DataGrid object and card_details is the id of the ContentPane)
grid
card_details
dojo.connect(grid, 'onRowClick', function(e) { var id = grid.getItem(e.rowIndex).id; var question = grid.getItem(e.rowIndex).question; var answer = grid.getItem(e.rowIndex).answer; dojo.byId('card_details').innerHTML = ''; var editor = new dijit.Editor({ id: 'editor', value: question }, dojo.byId('card_details')); });
The code above creates the dijit.Editor in the ContentPane but doesn't fill it with the value stored in the question variable (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 String or even something in Japanese like 反乱者 it works just fine.
My String
反乱者
It even works if I replace: var question = grid.getItem(e.rowIndex).question; with: var question = '反乱者';
var question = grid.getItem(e.rowIndex).question;
var question = '反乱者';
Does anybody know why it won't work when using the question variable when it has been assigned it's value via grid.getItem(e.rowIndex).question?
grid.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!
I have found the answer to my question now.
It turns out I just needed to change:
to:
var question = grid.store.getValue(grid.getItem(e.rowIndex), 'question');
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.
General Tech 10 Answers
General Tech 7 Answers
General Tech 3 Answers
General Tech 9 Answers
General Tech 2 Answers
Ready to take your education and career to the next level? Register today and join our growing community of learners and professionals.