[2.2]Problems with combobox
I have been developing an app using Ext2.1 , but when converting to 2.2 i've found that my combobox's give errors: "ls.push is not a function" , and the drop down list does not open.
Converting back to Ext2.1 fixes the problem. Is there something that has changed between 2.1 and 2.2 that would cause this?
My code:
serviceStore = new Ext.data.Store({
proxy: new Ext.data.ScriptTagProxy({
url: ppOnline.base.getServiceURL()
}),
reader: new Ext.data.JsonReader({
root: 'results',
totalProperty: 'total',
id: 'placeStore',
fields: ['service']
}),
remoteSort: false
});
serviceStore.baseParams.class = 'Waybill';
serviceStore.baseParams.method = 'getServices';
serviceStore.baseParams.token_id = ppOnline.base.getToken();
serviceStore.load();
this.serviceFilterCombo = new Ext.form.ComboBox({
store: serviceStore,
id: 'serviceFilter',
fieldLabel: 'Service',
displayField: 'service',
forceSelection: true,
mode: 'local',
selectOnFocus: true,
triggerAction: 'all',
typeAhead: true,
width: 83
});
this.viewFilter = new Ext.Panel({
hideBorders: true,
frame: true,
layout: 'form',
labelWidth: 79,
labelAlign: 'left',
width: 200,
height: 220,
id: 'viewFilter',
items: [this.serviceFilterCombo, this.invoiceFilter, this.orighubFilter, this.desthubFilter, this.accountFilter, this.referenceFilter, this.waybillFilter, this.updateButton]
});
I've tried changing the mode to "remote", also tried populating the combo manually (removing the store and adding items individually) with the same result. Any idea's?
Thanks in advance
Thanks for the help!
Anyway, i guess this is not an Ext problem, just a problem with my code, back to debugging.
If i find anything useful i will post it here.
I had forgotten about. Curiously it worked with Ext.2.1.
No wonder I could not reproduce it outside my main application,
because I didn't include the json library there.
Thank you!
rmitchel
if(Object.prototype.asClone === undefined){
Object.prototype.asClone = function(){
// code block
}
}
I took that out and all the errors were handled. I had to find another signature for the 'clone' function. thanks for the hint.
Will that be fixed sometime ?
Cheers
Karsten
serviceStore.on('load', showServices);
function showServices()
{
for (var i = 0; i < serviceStore.getCount(); i++)
{
var record = serviceStore.getAt(i);
console.log(record.get(['service']));
}
}
Seems like its something to do with the Ext.DataView, somehow its not rendering. Or perhaps a scoping issue? As i said this code works perfectly with Ext2.1, but 2.2 seems to work a lot better, much faster loading times etc so i really would like to use it. Anyone know how i could change my code to work with 2.2?
Daniel
I am trying to write up some example code that reproduces the error. I will post it when I'm done.
I haven't been able to find any information on this bug either, though I suspect
it is because the release is still fairly new.
this.view is undefined
select()(0, true)ext-all-debug.js (line 27812)
onLoad()()ext-all-debug.js (line 27660)
doQuery()("", true)ext-all-debug.js (line 27902)
onTriggerClick()()ext-all-debug.js (line 27956)
h()()ext-all-debug.js (line 1694)
getViewWidth()()ext-base.js (line 10)
[Break on this error] this.view.select(index);
I have reported them here (http://www.extjs.com/forum/showthread.php?t=44049)
Same code works under Ext2.1
I don't think it is related to combobox though. I think it is something to do with
the new Event Management code that went into Ext2.2.
Upon reading your posts, I
tried to comment out all my combobox code, but I still got the errors.
If it helps debug the issue, the error happens whenever I open a modal popup window containing a form which includes a single combo box, a text field and an html editor.
And two buttons (submit and cancel ). When I start to mouseover the form, I get a stream of errors in Firebug 'ls.push is not a function'.
I attempted to put a breakpoint in ext-all-debug.js on line 1524 and it showed me that 'ls', object was null, though I don't know enough about Ext to know what this means. I also compared ext-all-debug.js from Ext2.2 with the one from Ext2.1, and the code which is causing the problem is new ( around line 1524 ), it didn't exist in Ext2.1. So looks like it is not a coding problem but an Ext problem.
File: ext-all-debug.js
Version: 2.2
Line: 1710
Change: Add "extend" to the regular expression stored in the variable propRe
I hope this helps.
Daniel
This is what I did to trace this:
1) Turn on firebug with the Break on all errors debugger option turned on.
2) Once the code stopped on line 1524, I hovered over the ename and saw that it was trying to reference toJSONString
3) This was causing ls to become a function() instead of staying as an array. Hence, the reason there is no push method.
4) I realized I had another json library on my page: http://www.JSON.org/js.html
5) In this json library, there is also a toJSONString.
So I removed the json library (Which I don't need because there are utils already in ExtJS), and I no longer had the ls.push not found.
I hope this helps!
Kenton
#If you have any other info about this subject , Please add it free.# |