Aug 24, 2012, 11:00 PM
[CLOSED] DirectEvent and GridPanel
I am trying to use a direct method to call a partial view which has a grid panel. I am following the example from the MVC examples (2.1) under "Grid Panel/Direct Event Create" The code is executing, but I keep getting a javascript error.
Here is my button:
"TypeError: Con is not a constructor on line 47180 for http://localhost:1859/extjs/ext-all-debug-js/ext.axd?v=11375"
Here is where it breaks:
Here is my button:
@(Html.X.Button().ID("btnSubmit").Text("DirectRun") _
.DirectEvents(Sub(evnts)
With evnts
With .Click
.Url = Url.Action("Index")
.Method = HttpMethod.POST
.EventMask.ShowMask = True
.Success = "onSuccess(App.filterResults, result.result);"
End With
End With
End Sub))
Here is my partial view:@ModelType List(Of Enterprise.Business.DocTracking.Web.Models.CWFilterResults)
@(Html.X.GridPanel() _
.ID("filterResults") _
.Layout(LayoutType.Fit) _
.Scroll(ScrollMode.Both) _
.SetAutoScroll(True) _
.TopBar(Sub(top)
'removed until testing works.
End Sub
) _
.Store(Sub(store)
Dim s As New Ext.Net.Store()
Dim mdl As New Ext.Net.Model()
Dim rdr As New Ext.Net.ArrayReader()
With mdl
.Fields.Add(New Ext.Net.ModelField() With {.Name = "RequestID", .Type = ModelFieldType.Int})
.Fields.Add(New Ext.Net.ModelField() With {.Name = "DocumentID", .Type = ModelFieldType.Int})
.Fields.Add(New Ext.Net.ModelField() With {.Name = "SlipStatus"})
.Fields.Add(New Ext.Net.ModelField() With {.Name = "DocumentName"})
.Fields.Add(New Ext.Net.ModelField() With {.Name = "DocumentType"})
.Fields.Add(New Ext.Net.ModelField() With {.Name = "DocumentStatus"})
.Fields.Add(New Ext.Net.ModelField() With {.Name = "RequestType"})
.Fields.Add(New Ext.Net.ModelField() With {.Name = "RequestStatus"})
.Fields.Add(New Ext.Net.ModelField() With {.Name = "EmployeeID"})
.Fields.Add(New Ext.Net.ModelField() With {.Name = "TermsEffectiveDate", .Type = ModelFieldType.Date})
.Fields.Add(New Ext.Net.ModelField() With {.Name = "CedentCode"})
.Fields.Add(New Ext.Net.ModelField() With {.Name = "CedentName"})
.Fields.Add(New Ext.Net.ModelField() With {.Name = "ContractName"})
.Fields.Add(New Ext.Net.ModelField() With {.Name = "Correspondent"})
.Fields.Add(New Ext.Net.ModelField() With {.Name = "Drafter"})
.Fields.Add(New Ext.Net.ModelField() With {.Name = "RequestDate", .Type = ModelFieldType.Date})
.Fields.Add(New Ext.Net.ModelField() With {.Name = "Reviewer"})
.Fields.Add(New Ext.Net.ModelField() With {.Name = "SlipCode"})
.Fields.Add(New Ext.Net.ModelField() With {.Name = "DueDate", .Type = ModelFieldType.Date})
End With
With s
.ID = "filterResultsData"
.DataSource = Model
.AutoLoad = True
.Model.Add(mdl)
.AutoSync = True
.RemotePaging = False
.Reader.Add(rdr)
.PageSize = 25
End With
store.Add(s)
End Sub) _
.ColumnModel(Sub(cols)
cols.Add(Html.X.RowNumbererColumn().ID("teamRowNum").Width(35))
cols.Add(Html.X.Column().DataIndex("DocumentType").Width(100).Text("Type"))
cols.Add(Html.X.Column().DataIndex("CedentName").Width(250).Text("Cedent"))
cols.Add(Html.X.Column().DataIndex("SlipCode").Width(65).Text("Slip Code"))
cols.Add(Html.X.Column().DataIndex("SlipStatus").Width(75).Text("Slip Status"))
cols.Add(Html.X.Column().DataIndex("DocumentStatus").Width(150).Text("Status"))
cols.Add(Html.X.Column().DataIndex("RequestType").Width(85).Text("Request Type"))
cols.Add(Html.X.Column().DataIndex("RequestStatus").Width(85).Text("Request Status"))
cols.Add(Html.X.DateColumn().DataIndex("TermsEffectiveDate").Width(80).Align(Alignment.Right).Text("Effective Date").Format("M/d/y"))
cols.Add(Html.X.DateColumn().DataIndex("DueDate").Text("Due Date").Width(75).Align(Alignment.Right).Format("M/d/y"))
cols.Add(Html.X.Column().DataIndex("ContractName").Text("Contract").Width(200))
cols.Add(Html.X.Column().DataIndex("ContractPeriod").Text("Contract Period").Width(100).Hidden(True))
cols.Add(Html.X.Column().DataIndex("Correspondent").Text("Correspondent").Width(150).Hidden(True))
cols.Add(Html.X.Column().DataIndex("Drafter").Text("Drafter").Width(150).Hidden(True))
cols.Add(Html.X.Column().DataIndex("Reviewer").Text("Reviewer").Width(150).Hidden(True))
cols.Add(Html.X.DateColumn().DataIndex("RequestDate").Text("Request Date").Width(80).Hidden(True).Align(Alignment.Right).Format("M/d/y"))
End Sub) _
.BottomBar(Sub(footer)
Dim pager As New Ext.Net.PagingToolbar()
With pager
.AutoDataBind = True
.HideRefresh = True
End With
footer.Add(pager)
End Sub) _
.Focus() _
.Selectable(True) _
.Title("Search Results"))
Here is part of my controller: Return Me.Direct(Me.Manager.Filter.Select(xDoc.ToString()).ToArray())
Here is the error:"TypeError: Con is not a constructor on line 47180 for http://localhost:1859/extjs/ext-all-debug-js/ext.axd?v=11375"
Here is where it breaks:
create: function(config, name, id) {
var Con = typeof name == 'function' ? name : this.types[name || config.name];
return new Con(config, id);
}
When reviewing the code, config contains my array of results, but name and id are null. The code never makes it to the "onSuccess" event. I think I am following the example almost verbatim. However, is there anything obvious here I am missing?
Last edited by Daniil; Sep 03, 2012 at 5:12 PM.
Reason: [CLOSED]