Sencha Touch: Declaring class using Ext.define() - sencha-touch

I am new to Sencha Touch(a js framework for cross platform apps).
While, learning sencha , I came across a strange problem, I searched out almost every where but couldn't find any.
Problem
I declared a Model named "UserPass" using
Ext.define('MyApp.model.UserPass',{other params});
I connected that model to a store , added some values everything was working fine.
Then for some reason , I changed the name of the model from "UserPass" to "User-Pass" i.e like.
Ext.define('MyApp.model.User-Pass',{other params});
It stopped working.
I tried to change the Model names more times using 'dash' and without dash.
With 'UserPass', the code works fine but using 'User-Pass' the code stops working.
Is this a problem with the "dash" between "User" and "Pass" in the name of model?
Or anything else that is not coming to my wit?

It is not allowed in sencha simply.
May be as using hyphens is deprecated/not allowed in variables in javascript.
See this link please .
Parrots answer explains good.
Javascript and CSS, using dashes

Related

wxGrid - RefreshBlock Undocumented Member Function

In order to refresh a part of the grid, i.e., when font or alignment changes, I was using the following approach:
wxRect rect1=CellToRect(TopLeft);
wxRect rect2=CellToRect(BottomRight);
wxRect r(rect1.GetTopLeft(), rect2.GetBottomRight());
RefreshRect(r);
This was refreshing only a part of the intended block and was not working correctly.
From the suggestions of intellisense I came across RefreshBlock function and it works correctly. I searched the docs and have not found any information on it. I wonder if it is not recommended to use RefreshBlock for some reason? What does RefreshBlock do, does it refresh a block (as the name suggests) or is it equivalent to Refresh?
I am using wxWidgets 3.2 on Win10.
Thanks in advance.
The function RefreshBlock() is indeed the best way to do what you want and it was only undocumented by mistake, i.e. we simply forgot to do it. I've added documentation for it only now, so it will only get included in 3.2.1, but you can still use it in your code, the function itself is available since 3.1.3.
It seems from the source code that, depending on the location of its parameters, RefreshBlock refreshes any of the following:
corner grid
frozen cols grid
frozen rows grid
main grid
Since the area I wanted to refresh was on the main grid the following approach works (the idea is similar to RefreshBlock's approach):
auto GridWnd = CellToGridWindow(TL);
wxRect rect = BlockToDeviceRect(TL, BR, GridWnd);
GetGridWindow()->RefreshRect(rect);
Now everything is refreshed correctly.
Notes:
If only RefreshRect(rect) is called, things will NOT work as expected.
Little experiment showed that BlockToDeviceRect(TL, BR) also works, therefore eliminating the need for auto GridWnd = CellToGridWindow(TL);

Minecraft Modding Using Forge: GradleStart is in default package?

My project runs, and I see my mod populating within Minecraft, but for some reason my code doesn't do anything. I followed a basic tutorial that should be adding an item with a texture. I also set some basic method as such within Main to test whether this is working or not:
public void onPlayerTick(TickEvent.PlayerTickEvent tick)
{
System.out.println("testing 123");
}
Upon loading of the world, this doesn't output anything.
Any help?
I think it's working now. I made the dev environment again, this time with a different tutorial from the beginning. The main difference was this tutorial used intellij like me, unlike the other tutorial which used eclipse. Seems to be working because something in the init method printed out something in the format that is expected in the console (meaning it is compiling and using the code properly). So it appears to be working... It seems. I used these tutorials, they were very in depth, would recommend regardless. This is the playlist: https://www.youtube.com/playlist?list=PLxZiPYkNuhkQKH-QlM0C_3-LvjbQA8ZAu

mogenerator doesn't generate the files

I've just installed mogenerator using one of tutorials. I have added run script to my new target, and clicked Cmd+B. I should get some new files, but i didn't. In my .xcdatamodeld i have 2 entities (User and Repos). Below you can find my print screen of my project.
Where is the problem in my thinking? What should i do more? Please, help me, because i haven't found the solution on the web yet.
This all looks fine (judging by your screenshot).
One thing to check - which caused me the same issue - is that, when you've created your Entities in the xcdatamodelId file, make sure that you click on the Data Model Inspector icon, and that each entity has a Name value, and a matching "Class" value.
Miss out the Class name, and nothing will get generated.
Btw, when you click on Build, do you get a "Build succeeded" message ?
Here's the tutorial I followed to get mogenerator working:
RaptureInVenice
I should say, I've used mogenerator in a few projects, and this command line bit is always the piece that gives me trouble. Sometimes, I have to select my xcdatamodelId file, and create a new Version of it, before mogenerator will use it. But once it is working, it's a blessing.
Anything to avoid having to use the needlessly over-complicated CoreData stuff.
Someone should remind Apple that it's 2014...

Rails and mongoid: What is going on with RC7 and embedded documents?

Until now I was using rc6 and I decided to upgrade, but it's totally
breaking my app ? Maybe I am doing something wrong, but I believe I
followed the documentation.
I have a model Content that embeds_many Localized_Content.
Once I have a content created and wanted to added a localized content
I would do the following:
#content = Content.find('xxx')
#new_content = #content.localized_contants.build()
#new_content.save
This is working perfectly fine under rc6 and updates correctly all the
timestamps in localized_contant (using include Mongoid::Timestamps)
But doing the same thing in rc7 break with the following error:
"Access to the collection for LocalizedContent is not allowed since it
is an embedded document, please access a collection from the root
document."
Ok, maybe I need to save directly from the parent content then ok.
Doing a
#content.save
works but will not trigger all the timestamping
and this breaks the logic of my apps... what should I do ?
#content.save is the way to go. You should refactor your code to call save() on the parent object instead of the embedded document.

Dojo - Some of my form.dijit's seem to be dead/inactive on one page

I was started to work on my first sample of the dijit.Tree control.
When it didn't work, I added a couple of dijit.form.Textbox'es to the screen, and they didn't work either, even though I have them working fine on a similar form.
Interesting enough, when I killed FireFox and restarted it, I was got a clear message in FireBug console on what was wrong with my tree control, and got it fixed.
But now I'm rather puzzled while the simple dijits like NumberTextBox that I added are not working.
My Samples:
1) http://3wcloud-com-provisioning-qa.appspot.com/testDijitDate - this works great
(except the initial date value not showing - I have a separate question open on that)
2) http://3wcloud-com-provisioning-qa.appspot.com/testDijitTree
I've done several "diff"s on the two files, and I kind find the difference that would cause one to work and one not to work.
Thanks,
Neal
You should put your dojo.require statements immediately in a script block, not wrapped in the onload callback. Also, your input tags should be HTML style without the XHTML style slash (you didn't declare XHTML in your document) though I doubt that's the problem. See if either of those things help.