PDA

View Full Version : KeyMap - help



AntiSpeed
9 May 2010, 1:20 AM
hey
first: sorry for my english. im german :D (first post in an english forum; pls correct my english)
quest: i dont check how to make that keymap work..
here the test.js


var map = new Ext.KeyMap(document, [
{
key: '0123456789',
fn: function(){alert('that was a number')}
},{
key: [96,97,98,99,100,101,102,103,104,105],
fn: function(){alert('that was a number')}
}
]);

test.html


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<head>
<link rel="stylesheet" type="text/css" href="../ext/resources/css/ext-all.css">
<script type="text/javascript" src="../ext/adapter/ext/ext-base.js"></script>
<script type="text/javascript" src="../ext/ext-all.js"></script>
<script type="text/javascript" src="test.js"></script>
</head>
<body></body>
</html>

extjs is in the right folder.
thx4help

AntiSpeed
9 May 2010, 11:04 AM
can anyone help me please?

Animal
9 May 2010, 11:32 AM
Probably the DOM is not ready.

Use Ext.onReady as in the examples.

AntiSpeed
10 May 2010, 3:41 AM
ok. this was the problem.
thx.