ipreti
30 Sep 2009, 11:27 AM
Hi guys,
When i try to load my multiselects on form.load() function im getting the following error message in firebug console:
this.view is undefined
anonymous("5")MultiSelect.js (line 258)
anonymous(Object template_Structure_Id=7)ext-all-debug.js (line 56545)
anonymous(Object tId=10 status=200 statusText=OK)ext-all-debug.js (line 59147)
handleResponse(Object tId=10 status=200 statusText=OK)ext-all-debug.js (line 8550)
f(Object conn=XMLHttpRequest tId=10, Object scope=Object argument=Object timeout=30000, Object name=r, Object name=q)ext-base.js (line 7)
anonymous()ext-base.js (line 7)
chrome://firebug/content/blank.gif this.view.clearSelections();\n
This is related to this part of multiselect code that is called by form.load() function:
setValue: function(values) { 256 var index;
257 var selections = [];
258 this.view.clearSelections();
259 this.hiddenField.dom.value = '';
260
261 if (!values || (values == '')) {
262 return;
263 }
264
265 if (!Ext.isArray(values)) {
266 values = values.split(this.delimiter);
267 }
268 for (var i=0; i<values.length; i++) {
269 index = this.view.store.indexOf(this.view.store.query(this.valueField,
270 new RegExp('^' + values[i] + '$', "i")).itemAt(0));
271 selections.push(index);
272 }
273 this.view.select(selections);
274 this.hiddenField.dom.value = this.getValue();
275 this.validate();
276 }
The weird part is... every time i use the debug mode of firebug i dont get this message, in another words, it works properly!.
But if i try to call the form normally, it doesnt work.
My multiselect uses a static store and the code is like this:
var dayofweekselector = {
xtype: 'multiselect',
height: 200,
name: 'dayOfWeek',
bodyStyle: 'padding-left:5px;',
tbar:[{
text: 'Days of Week',
handler: function(){
form.getForm().findField('dayOfWeek').setValue('2,3');
}
}],
store: [
['1', '01'], ['2', '02'], ['3', '03'], ['4', '04'], ['5', '05'],
['6', '06'], ['7', '07']]
};
When I try to load this multiselect i call my action that answers a json containing '2,3' as value for a dayOfWeek field..
I know that its working because the setValue function is correctly called.
Does someone know the answer for this? This is driving me crazy.
I think it is something related to assincronous call or smth like that.. because it seems that when i'm in debug mode the variable 'this.view' might've already been initialized, i dont know..
Thanks in advance.
Ivan.
When i try to load my multiselects on form.load() function im getting the following error message in firebug console:
this.view is undefined
anonymous("5")MultiSelect.js (line 258)
anonymous(Object template_Structure_Id=7)ext-all-debug.js (line 56545)
anonymous(Object tId=10 status=200 statusText=OK)ext-all-debug.js (line 59147)
handleResponse(Object tId=10 status=200 statusText=OK)ext-all-debug.js (line 8550)
f(Object conn=XMLHttpRequest tId=10, Object scope=Object argument=Object timeout=30000, Object name=r, Object name=q)ext-base.js (line 7)
anonymous()ext-base.js (line 7)
chrome://firebug/content/blank.gif this.view.clearSelections();\n
This is related to this part of multiselect code that is called by form.load() function:
setValue: function(values) { 256 var index;
257 var selections = [];
258 this.view.clearSelections();
259 this.hiddenField.dom.value = '';
260
261 if (!values || (values == '')) {
262 return;
263 }
264
265 if (!Ext.isArray(values)) {
266 values = values.split(this.delimiter);
267 }
268 for (var i=0; i<values.length; i++) {
269 index = this.view.store.indexOf(this.view.store.query(this.valueField,
270 new RegExp('^' + values[i] + '$', "i")).itemAt(0));
271 selections.push(index);
272 }
273 this.view.select(selections);
274 this.hiddenField.dom.value = this.getValue();
275 this.validate();
276 }
The weird part is... every time i use the debug mode of firebug i dont get this message, in another words, it works properly!.
But if i try to call the form normally, it doesnt work.
My multiselect uses a static store and the code is like this:
var dayofweekselector = {
xtype: 'multiselect',
height: 200,
name: 'dayOfWeek',
bodyStyle: 'padding-left:5px;',
tbar:[{
text: 'Days of Week',
handler: function(){
form.getForm().findField('dayOfWeek').setValue('2,3');
}
}],
store: [
['1', '01'], ['2', '02'], ['3', '03'], ['4', '04'], ['5', '05'],
['6', '06'], ['7', '07']]
};
When I try to load this multiselect i call my action that answers a json containing '2,3' as value for a dayOfWeek field..
I know that its working because the setValue function is correctly called.
Does someone know the answer for this? This is driving me crazy.
I think it is something related to assincronous call or smth like that.. because it seems that when i'm in debug mode the variable 'this.view' might've already been initialized, i dont know..
Thanks in advance.
Ivan.