PDA

View Full Version : [4.1 B1] Ext.util.CSS.getRule("." + Ext.baseCSSPrefix + "form-trigger") is undefined



slemmon
23 Jan 2012, 3:19 PM
Did anyone find a workaround for the error:
Ext.util.CSS.getRule("." + Ext.baseCSSPrefix + "form-trigger") is undefined

in B1 or is this a good instance to hold tight for B2 and see what happens?


Ext.widget('window', {
title: 'My Window'
, height: 300
, width: 530
, autoShow: true
, layout: 'fit'
, items: [{
xtype: 'tabpanel'
, items: [{
xtype: 'panel'
, title: 'Tab'
, bodyCls: 'stripey-bg'
, layout: 'hbox'
, bodyPadding: 10
, autoScroll: true
, dockedItems: [{
xtype: 'toolbar'
, dock: 'right'
, cls: 'light-toolbar light-toolbar-right light-toolbar-left'
, items: [{
text: 'Add'
, handler: function (btn) {
var store= btn.up('panel').down('grid').getStore();
store.add({foo: 'bar2'})
}
}, {
text: 'Del'
}]
}]
, items: [{
xtype: 'form'
, border: false
, flex: 2
, defaultType: 'fieldcontainer'
, layout: 'anchor'
, anchor: '100%'
, defaults: {
layout: 'hbox'
, defaultType: 'radiofield'
, labelWidth: 140
, defaults: { flex: 1 }
}
, items: [{
xtype: 'textfield'
, fieldLabel: 'App Name'
, name: 'APP_NM_TXT'
, hidden: true
, validator: function (val) {
if (this.isHidden()) {
return true;
} else {
if (val.length > 0) {
return true;
} else {
return 'The app name field is required.';
}
}
}
}, {
xtype: 'numberfield'
, fieldLabel: 'Max Session Min.'
, name: 'MAX_SESSION_MIN_NO'
, value: 480
, minValue: 0
, allowBlank: false
}, {
xtype: 'numberfield'
, fieldLabel: 'Total Attempts'
, name: 'TTL_ATTEMPTS_NO'
, value: 3
, minValue: 0
, allowBlank: false
}, {
fieldLabel: 'Multi Logon'
, items: [{
boxLabel: 'T'
, name: 'MULTI_LOGON_IND'
, inputValue: 'T'
}, {
boxLabel: 'F'
, name: 'MULTI_LOGON_IND'
, inputValue: 'F'
, checked: true
}]
}, {
fieldLabel: 'Persist Session'
, items: [{
boxLabel: 'T'
, name: 'PERSIST_SESSION_IND'
, inputValue: 'T'
, checked: true
}, {
boxLabel: 'F'
, name: 'PERSIST_SESSION_IND'
, inputValue: 'F'
}]
}, {
fieldLabel: 'Null Token'
, items: [{
boxLabel: 'T'
, name: 'NULL_TOKEN_IND'
, inputValue: 'T'
}, {
boxLabel: 'F'
, name: 'NULL_TOKEN_IND'
, inputValue: 'F'
, checked: true
}]
}, {
fieldLabel: 'Use Last Session'
, items: [{
boxLabel: 'T'
, name: 'USE_LST_SESSION_IND'
, inputValue: 'T'
, checked: true
}, {
boxLabel: 'F'
, name: 'USE_LST_SESSION_IND'
, inputValue: 'F'
}]
}, {
xtype: 'textfield'
, fieldLabel: 'Key Text'
, name: 'KEY_TXT'
}]
}, {
xtype: 'grid'
, flex: 1
, columns: [{text: 'Header', dataIndex: 'foo'}]
, store: {
fields: ['foo']
, data: [{
foo: 'bar'
}]
}
}]
}]
}]
})

shmeltex
23 Jan 2012, 9:07 PM
Make sure you are using ext-all.css from 4.1b1, and not from previous version.

slemmon
24 Jan 2012, 5:53 AM
The error I'm getting before was when I dropped that code that works in 4.0.7 into the examples widget in the 4.1 B2 download's docs.

I just tested the following directly in a separate file on Chrome and got:
Uncaught TypeError: Cannot read property 'style' of undefined


<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"><html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>Placeholder</title>
<link rel="stylesheet" type="text/css" href="../../resources/css/ext-all.css" />


<!-- GC -->


<script type="text/javascript" src="../../ext-all-debug-w-comments.js"></script>
<script>
Ext.onReady(function () {
Ext.widget('window', {
title: 'My Window'
, height: 300
, width: 530
, autoShow: true
, layout: 'fit'
, items: [{
xtype: 'tabpanel'
, items: [{
xtype: 'panel'
, title: 'Tab'
, bodyCls: 'stripey-bg'
, layout: 'hbox'
, bodyPadding: 10
, autoScroll: true
, dockedItems: [{
xtype: 'toolbar'
, dock: 'right'
, cls: 'light-toolbar light-toolbar-right light-toolbar-left'
, items: [{
text: 'Add'
, handler: function (btn) {
var store= btn.up('panel').down('grid').getStore();
store.add({foo: 'bar2'})
}
}, {
text: 'Del'
}]
}]
, items: [{
xtype: 'form'
, border: false
, flex: 2
, defaultType: 'fieldcontainer'
, layout: 'anchor'
, anchor: '100%'
, defaults: {
layout: 'hbox'
, defaultType: 'radiofield'
, labelWidth: 140
, defaults: { flex: 1 }
}
, items: [{
xtype: 'textfield'
, fieldLabel: 'App Name'
, name: 'APP_NM_TXT'
, hidden: true
, validator: function (val) {
if (this.isHidden()) {
return true;
} else {
if (val.length > 0) {
return true;
} else {
return 'The app name field is required.';
}
}
}
}, {
xtype: 'numberfield'
, fieldLabel: 'Max Session Min.'
, name: 'MAX_SESSION_MIN_NO'
, value: 480
, minValue: 0
, allowBlank: false
}, {
xtype: 'numberfield'
, fieldLabel: 'Total Attempts'
, name: 'TTL_ATTEMPTS_NO'
, value: 3
, minValue: 0
, allowBlank: false
}, {
fieldLabel: 'Multi Logon'
, items: [{
boxLabel: 'T'
, name: 'MULTI_LOGON_IND'
, inputValue: 'T'
}, {
boxLabel: 'F'
, name: 'MULTI_LOGON_IND'
, inputValue: 'F'
, checked: true
}]
}, {
fieldLabel: 'Persist Session'
, items: [{
boxLabel: 'T'
, name: 'PERSIST_SESSION_IND'
, inputValue: 'T'
, checked: true
}, {
boxLabel: 'F'
, name: 'PERSIST_SESSION_IND'
, inputValue: 'F'
}]
}, {
fieldLabel: 'Null Token'
, items: [{
boxLabel: 'T'
, name: 'NULL_TOKEN_IND'
, inputValue: 'T'
}, {
boxLabel: 'F'
, name: 'NULL_TOKEN_IND'
, inputValue: 'F'
, checked: true
}]
}, {
fieldLabel: 'Use Last Session'
, items: [{
boxLabel: 'T'
, name: 'USE_LST_SESSION_IND'
, inputValue: 'T'
, checked: true
}, {
boxLabel: 'F'
, name: 'USE_LST_SESSION_IND'
, inputValue: 'F'
}]
}, {
xtype: 'textfield'
, fieldLabel: 'Key Text'
, name: 'KEY_TXT'
}]
}, {
xtype: 'grid'
, flex: 1
, columns: [{text: 'Header', dataIndex: 'foo'}]
, store: {
fields: ['foo']
, data: [{
foo: 'bar'
}]
}
}]
}]
}]
})
});
</script>


</head>
<body id="docbody">


</body>
</html>

brentdooley999
24 Jan 2012, 11:55 AM
Take a look at this thread.

http://www.sencha.com/forum/showthread.php?174706-4.1.0-beta-1-BUG-Error-when-opening-some-form-examples

I get this problem when my code is on a different domain/sub domain as my application.

I'm not sure of Sencha's stance on this bug at the moment. It doesn't look like they've re-opened the bug.

Hope this helps.

slemmon
24 Jan 2012, 12:41 PM
Oh, that's right... I remember seeing that now. I was debugging on my computer earlier without an Internet connection so would have had to wait until I was able to sync back up with a web server.

Thx.