-
8 Apr 2012 5:32 AM #1
[RC1, RC2] Ext.form.field.ComboBox exception
[RC1, RC2] Ext.form.field.ComboBox exception
Hello,
I have a bug since the RC1 (perhaps the B3 but not sure) on the combobox component.
I am using the grid with rowEditing plugin, with some combobox on editor field.
The problem is I need to show the selected record from combo without loading the combo remotly when the user edit the field.
So, I am adding the missing record to the combo manually but then when I try to expand the combo I have this exception with RC1:
This is the traceback when using extjs 4.1 RC2:Code:Uncaught TypeError: Cannot read property 'internalId' of undefined Ext.define.updateIndexesext-all-dev.js:88469 Ext.define.refreshext-all-dev.js:88237 Base.implement.callParentext-all-dev.js:6030 Ext.define.refreshext-all-dev.js:145286 Base.implement.callParentext-all-dev.js:6030 Ext.define.refreshext-all-dev.js:145468 Ext.define.onDataRefreshext-all-dev.js:88544 fireext-all-dev.js:13918 Ext.define.continueFireEventext-all-dev.js:35444 Ext.define.fireEventext-all-dev.js:35415 Ext.define.loadRecordsext-all-dev.js:73264 Ext.define.onProxyLoadext-all-dev.js:72959 Ext.define.processResponseext-all-dev.js:56417 (anonymous function)ext-all-dev.js:71818 Ext.apply.callbackext-all-dev.js:10575 Ext.define.onCompleteext-all-dev.js:53167 Ext.define.onStateChangeext-all-dev.js:53105 (anonymous function)
I am using this code for adding the missing record to the combo store:Code:Uncaught TypeError: Cannot read property 'internalId' of undefined Ext.define.updateIndexesext-all-dev.js:89481 Ext.define.refreshext-all-dev.js:89244 Base.implement.callParentext-all-dev.js:6144 Ext.define.refreshext-all-dev.js:146195 Base.implement.callParentext-all-dev.js:6144 Ext.define.refreshext-all-dev.js:146377 Ext.define.onDataRefreshext-all-dev.js:89556 fireext-all-dev.js:14093 Ext.define.continueFireEventext-all-dev.js:35760 Ext.define.fireEventext-all-dev.js:35731 Ext.define.loadRecordsext-all-dev.js:74067 Ext.define.onProxyLoadext-all-dev.js:73762 Ext.define.processResponseext-all-dev.js:56895 (anonymous function)ext-all-dev.js:72619 Ext.apply.callbackext-all-dev.js:10735 Ext.define.onCompleteext-all-dev.js:53645 Ext.define.onStateChangeext-all-dev.js:53583 (anonymous function)
I need to show a record without loading the store remotly for each ComboBox of my project. This exception also occured when combo are included in Form.Code:this.getStore().add({ id: id, name: name });
I tried to add the missing record before and after combo rendering. I even tried to trick the pageSize attribute (by adding +1 for this record).
My code worked fine since the B1 but with RC1 and RC2 I am having this problem plus rendering/layout problem (without any exceptions this time).
Does anybody know a workaround for this combo problem ?
Thank you !Last edited by bydooweedoo; 8 Apr 2012 at 5:59 AM. Reason: Add extjs RC2 traceback.
-
10 Apr 2012 2:07 PM #2
same here.
combobox raises error if you use pagesize with remote data
RC2
-
10 Apr 2012 5:14 PM #3
Can't reproduce, can I get a test case?
Code:Ext.onReady(function() { var store = Ext.create('Ext.data.Store', { fields: ['name', 'value'], pageSize: 1, proxy: { type: 'ajax', url: 'data.php', reader: { type: 'json', totalProperty: 'total', root: 'data' } } }); Ext.create('Ext.form.field.ComboBox', { store: store, displayField: 'name', valueField: 'value', pageSize: 1, renderTo: document.body, width: 500 }) });PHP Code:<?php
$start = $_REQUEST["start"];
if ($start == 0) {
$name = "Foo";
$value = 1;
} else if ($start == 1) {
$name = "Bar";
$value = 2;
} else {
$name = "Baz";
$value = 3;
}
?>
{
"total": 3,
"data": [{
"name": "<?php echo $name ?>",
"value": <?php echo $value ?>
}]
}Evan Trimboli
Sencha Developer
Twitter - @evantrimboli
Don't be afraid of the source code!
-
11 Apr 2012 8:08 AM #4
Hello,
Here is a test case:
test-case.html
test-case.jsHTML Code:<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> <html> <head> <title>Combo RC2 exception</title> <link href="/extjs4/resources/css/ext-all-gray.css" media="screen" rel="stylesheet" type="text/css" /> <meta http-equiv="content-type" content="text/html; charset=utf-8" /> </head> <body> <!-- extjs --> <script type="text/javascript" src="/extjs4/ext-all-dev.js"></script> <script type="text/javascript" src="test-case.js"></script> </body> </html>
data.jsonCode:Ext.onReady(function() { Ext.define('TestCaseModel', { extend: 'Ext.data.Model', idProperty: 'id', fields: [{ name: 'id' }, { name: 'name', type: 'string' }] }); var store = Ext.create('Ext.data.Store', { autoLoad: false, pageSize: 50, model: 'TestCaseModel', proxy: { type: 'ajax', url: 'data.json', format: 'json', reader: { type: 'json', root: 'data', totalProperty: 'total' } } }); store.add({"id": 1, "name": "name #1"}); var app = Ext.create('Ext.container.Viewport', { layout: 'fit', items: [{ xtype: 'combo', store: store, valueField: 'id', displayField: 'name', forceSelection: true, pageSize: 50, value: 1 }] }); });
Hope it helps.Code:{"data": [{"id": 1, "name": "name #1"}, {"id": 2, "name": "name #2"}, {"id": 3, "name": "name #3"}], "total": 3, "success": true}
Thank you.
-
12 Apr 2012 12:53 AM #5
The same problem is here.
PHP Code:// load form from grid record
formWin.down('form').loadRecord(record);
// Bind combo value
formWin.getEl().mask('Please wait...');
formWin.down('combo').getStore().load(
{params: {query: record.data.worksite_name}, callback: function() {
formWin.getEl().unmask();
}}
);
formWin.down('combo').setValue(record.data.worksite_id);
formWin.down('combo').setRawValue(record.data.worksite_name);
formWin.down('combo').focus();
Thanks.Code:- Uncaught TypeError: Cannot read property 'internalId' of undefined
- Ext.define.updateIndexes ext-all-debug.js:61283
- Ext.define.refresh ext-all-debug.js:61075
- Base.implement.callParent ext-all-debug.js:3702
- Ext.define.refresh ext-all-debug.js:102847
- Base.implement.callParent ext-all-debug.js:3702
- Ext.define.refresh ext-all-debug.js:102976
- Ext.define.onDataRefresh ext-all-debug.js:61349
- fire ext-all-debug.js:8511
- Ext.define.continueFireEvent ext-all-debug.js:24534
- Ext.define.fireEvent ext-all-debug.js:24512
- Ext.define.loadRecords ext-all-debug.js:50107
- Ext.define.onProxyLoad ext-all-debug.js:49903
- Ext.define.processResponse ext-all-debug.js:39000
- (anonymous function) ext-all-debug.js:49272
- Ext.apply.callback ext-all-debug.js:6379
- Ext.define.onComplete ext-all-debug.js:37152
- Ext.define.onStateChange ext-all-debug.js:37103
- (anonymous function)
-
16 Apr 2012 5:16 AM #6
+1 on this one, there is no way we can use anything past 4.1 beta 2 until this is fixed. Adding records to ANY combos before clicking the trigger causes this to happen. Please fix this ASAP!
Also, I spent several hours attempting workarounds for this (which I am usually able to do), but was unsuccessful. If anyone finds anything, please post. RC3 fixes a lot of bugs that we needed fixed, but it's unusable without a fix for this.
-
17 May 2012 5:17 AM #7
This bug does not fire exception in 4.1.0 release but doesn't work either.
Any news about fixing this one ?
It would be great to fix it as soon as possible.
Thanks
Success! Looks like we've fixed this one. According to our records the fix was applied for
EXTJSIV-5907
in
4.1.


Reply With Quote