Jan 06, 2014, 11:30 AM
[FIXED] [2.5] TagField crashes when using StoreID property
Hello,
I have a problem using TagField with separately defined Store.
For the field declared as below:
because for me this.store is a String - id of the store.
in line 775 of the debug version of the js file
Thanks,
Damian
I have a problem using TagField with separately defined Store.
For the field declared as below:
<ext:TagField runat="server" ID="myTagField" StoreID="someStore" ForceSelection="true" Editable="false" HideSelected="true"
Note="Lorem ipsum lorem ipsum" ValueField="Code" DisplayField="Display" BlankText="All">
<CustomConfig>
<ext:ConfigItem Name="autoWidth" Value="true" />
</CustomConfig>
</ext:TagField>
I get the following error in function initTagsStore of a Ext.net.TagField class, because for me this.store is a String - id of the store.
'store' is undefined
initTagsStore : function () {
if (Ext.isArray(this.store)) {
this.displayField = "text";
this.valueField = "value";
return new Ext.data.Store({
data : this.store,
fields: [
"text",
"value",
"selected",
"iconCls",
"disabled",
"cls",
"qTitle",
"qTip",
"width",
"style",
"closable",
"overCls"
],
autoDestroy: true
});
}
return store; // JS ERROR HERE
}
I was able to provide fix for it, by overriding this method as follows:Ext.define('Ext.net.TagFieldFix', {
override: 'Ext.net.TagField',
initTagsStore: function ()
{
if (Ext.isArray(this.store))
{
this.displayField = "text";
this.valueField = "value";
return new Ext.data.Store({
data: this.store,
fields: [
"text",
"value",
"selected",
"iconCls",
"disabled",
"cls",
"qTitle",
"qTip",
"width",
"style",
"closable",
"overCls"
],
autoDestroy: true
});
}
else if (typeof this.store == 'String')
{
var st = Ext.StoreMgr.get(this.store);
return st;
}
return this.store;
}
});
However, I am quite new to both Ext.NET and Ext.js so I am not sure if the fix is suitable, it solved my issue though.Thanks,
Damian
Last edited by Daniil; Jan 07, 2014 at 5:23 AM.
Reason: [FIXED] [2.5]