May 23, 2018, 2:40 PM
Use StoreID in ComboBox ERROR : Uncaught TypeError: Cannot read property 'isEmptyStore' of undefined
I add tab use PartialView
Please help me
Thanks in advance
public ActionResult AddTab(string containerId)
{
var result = new PartialViewResult
{
ViewName = "PosInvoicePartialView",
ContainerId = containerId,
RenderMode = RenderMode.AddTo
};
this.GetCmp<TabPanel>("POSTabs").SetLastTabAsActive();
return result;
}
Here is my PosInvoicePartialView@(Html.X().Store().ID("LookupItemStore").AutoLoad(false)
.Proxy(Html.X().AjaxProxy()
.Url(Url.Action("LookupData", "Index", new { area = "Item" }))
.Reader(Html.X().JsonReader().RootProperty("data").TotalProperty("total"))
)
.Model(Html.X().Model()
.IDProperty("Id")
.Fields(
new ModelField("Id", ModelFieldType.Int),
new ModelField("OrganizationCode", ModelFieldType.String),
new ModelField("Code", ModelFieldType.String),
new ModelField("Description", ModelFieldType.String)
)
)
)
@(Html.X().Panel()
.Closable(true)
.Layout(LayoutType.Border)
.Title("POS - " + DateTime.Now.ToLongTimeString())
.Items(
Html.X().Panel()
.Header(false)
.Region(Region.North)
.Border(false)
.Layout(LayoutType.HBox)
.BodyPadding(5)
.Defaults(Html.X().Parameter().Name("margin").Value("0 5 0 0").Mode(ParameterMode.Value))
.LayoutConfig(new HBoxLayoutConfig { Align = HBoxAlign.Top })
.Items(
Html.X().ComboBox()
.Width(400)
.DisplayField("Code")
.ValueField("Id")
.FieldStyle("text-transform: uppercase;")
.TypeAhead(true)
.MinChars(0)
.PageSize(10)
.SelectOnTab(true)
.ForceSelection(true)
.ValidateOnBlur(true)
.ValidateOnChange(true)
.ListConfig(Html.X().BoundList()
.LoadingText("Searching...")
.ItemTpl(Html.X().XTemplate()
.Html(@<text>
<div class="search-item">
<h3>{Code}</h3>
{Description}
</div>
</text>)
)
.MinWidth(400)
)
.StoreID("LookupItemStore"),
Html.X().Button().Icon(Icon.Find).Text("Search")
),
Html.X().Panel()
.Title("Items Detail")
.Region(Region.Center)
.BodyPadding(5),
Html.X().FormPanel()
.Title("Invoice Information")
.Region(Region.East)
.MinWidth(400)
.Split(true)
)
)
But it has error when running
Uncaught TypeError: Cannot read property 'isEmptyStore' of undefined
at ctor.getStoreListeners (ext.axd?v=4.5.1:20)
at ctor.bindStoreListeners (ext.axd?v=4.5.1:20)
at ctor.bindStore (ext.axd?v=4.5.1:20)
at ctor.bindStore (ext.axd?v=4.5.1:20)
at ctor.initComponent (ext.axd?v=4.5.1:20)
at ctor.callParent (ext.axd?v=4.5.1:20)
at ctor.initComponent (ext.axd?v=4.5.1:733)
at ctor.constructor (ext.axd?v=4.5.1:20)
at new ctor (ext.axd?v=4.5.1:20)
at Object.widget (ext.axd?v=4.5.1:20)
at ctor.getStoreListeners (ext.axd?v=4.5.1:20)
at ctor.bindStoreListeners (ext.axd?v=4.5.1:20)
at ctor.bindStore (ext.axd?v=4.5.1:20)
at ctor.bindStore (ext.axd?v=4.5.1:20)
at ctor.initComponent (ext.axd?v=4.5.1:20)
at ctor.callParent (ext.axd?v=4.5.1:20)
at ctor.initComponent (ext.axd?v=4.5.1:733)
at ctor.constructor (ext.axd?v=4.5.1:20)
at new ctor (ext.axd?v=4.5.1:20)
at Object.widget (ext.axd?v=4.5.1:20)
Thanks in advance