Why am I receiving an uncaught type error from my KendoUI taghelper grid in my ASP.NET Core application? - asp.net-core

I have a tag helper KendoUI grid, the grid is filterable but when I added the filter properties I get an error message back of:
Uncaught TypeError: t is undefined kendo.all.js:96768:38
If I remove the line of code that sets the grid as filterable it works but there is no filtering capability.
<filterable enabled="true" mode="row" />
Looking at this closely, removing the property of mode=¬row" causes the error to go away however, as above there are no filter capabilities.
Here is the complete code for my grid as it stands:
<kendo-grid name="addVesselPositionGrid" deferred="false">
<datasource type="DataSourceTagHelperType.Ajax" page-size="10">
<transport>
<read url="/Core/ReadVessels" />
</transport>
<schema>
<model id="Id">
<fields>
<field name="Id" editable="false"></field>
<field name="Name" type="Name" />
<field name="IMO" type="IMO" />
</fields>
</model>
</schema>
</datasource>
<sortable enabled="true" />
<pageable enabled="true" />
<filterable enabled="true" mode="row" />
<columns>
<column field="Id" title="Id" hidden="true"></column>
<column field="Name" title="Name">
<filterable multi="true">
<cell operator="Contains" suggestion-operator="Contains"></cell>
</filterable>
</column>
<column field="IMO" title="IMO"></column>
</columns>
</kendo-grid>
I've searched the documentation but I can't find any information on this, looking at my code it seems to be accurate. Any ideas?

Related

Extract multiple date strings from a single varchar(MAX) column SQL Server

I've inherited a report spec subsystem that needs to be tweaked. The mission is to add a date column to the tReports table, and populate it with the CreateDate that is (supposed to be) contained in the XML Code Spec. The problem is that some of the older reports don't have the CREATEDATE attribute, or as in one example below, the XML is valid but poorly formed, and the CREATEDATE cannot be retrieved using the xQuery that works for most of the other reports. Since I don't have an explicit creation date included in the spec, I'm using interpolation to estimate a reasonable date. One factor of the interpolation is to look at the date strings contained in the report spec--some will be useful, others not.
There are too many reports (over 1,200) to visually skim each report spec for date strings. These date strings can appear in any location in the report spec, and there are a very large number of combinations of elements and attributes that can contain a date string.
The ideal solution would be a listing of the reportID's and the date string ready to use in an UPDATE, but because date format varies (m/d/yy, mm/dd/yy, m/dd/yy ...) I'd be grateful to get a vew spurious characters surrounding the date string that I could clean up later.
All the date strings will be from 2000 or later, so the search string I'v been using is '/20' which has provided good results.
I've looked at many sites that discuss this kind of issue, and found only one solution by Mikael Eriksson that is something like what I'm describing, but I can't make it work after several hours of playing with it. How to extract multiple strings from single rows in SQL Server
Is there a way, without using a cursor nor WHILE loop, to extract these embedded dates?
-- Some representative data: (I'm using SQL Server 2008 R2)
CREATE TABLE #ReportSpecs (ReportID INT, ReportSpec VARCHAR(MAX))
INSERT INTO #ReportSpecs
( ReportID, ReportSpec )
VALUES
(136,
'<ReportID>136</ReportID>
<EmpIDCreator>23816</EmpIDCreator>
<EmpName>Blanc, Melvin J</EmpName>
<ReportType>0</ReportType>
<ReportName>PSST Sys Spec</ReportName>
<ReportData>
<REPORT>
<COLUMNS>
<Column Name="JobNumber" Position="1" />
<Column Name="TaskType" Position="2" />
<Column Name="Assignees" Position="3" />
<Column NAME="JobDueDate" Position="4" />
<Column Name="ReferenceNumber" Position="5" />
<Column Name="Deliverable" Position="6" />
<Column Name="Priority" Position="7" />
</COLUMNS>
<FILTERS>
<FILTER NAME="TYPE" VALUE="To_Me" />
<FILTER NAME="Status" VALUE="All" />
<FILTER NAME="DateOptions" VALUE="DateRange" From="8/16/2002" To="8/23/2002" />
<FILTER NAME="FromDate" VALUE="8/16/2002" />
<FILTER NAME="ToDate" VALUE="8/23/2002" />
<FILTER NAME="Role" VALUE="All" />
</FILTERS>
<parameters>
<PARAMETER NAME="#Cascading" TYPE="integer" VALUE="0" />
<PARAMETER NAME="#EmpID" SYSTEM="true" TYPE="integer" VALUE="#Request.EmployeeIDAlias#" />
<PARAMETER NAME="#FromOrgs" TYPE="varchar(250)" VALUE="" />
<PARAMETER NAME="#ToOrgs" TYPE="varchar(250)" VALUE="" />
</parameters>
<NAME>PSST Sys Spec</NAME>
<OWNER>
<ID>23816</ID>
</OWNER>
<source id="8" useinternalid="True" />
</REPORT>
</ReportData>'),
(311,
'<ReportID>311</ReportID>
<EmpIDCreator>7162</EmpIDCreator>
<EmpName>Potter, Harry J</EmpName>
<ReportType>0</ReportType>
<ReportName>CPVC Synch Test</ReportName>
<ReportData>
<REPORT>
<COLUMNS>
<Column Name="JobNumber" Position="1" />
<Column Name="TaskType" Position="2" />
<Column Name="Subject" Position="3" />
<Column Name="CurrentAssignee" Position="4" />
<Column NAME="JobDueDate" Position="5" />
<Column Name="Deliverable" Position="6" />
<Column Name="Category" Position="7" />
<Column Name="Priority" Position="8" />
</COLUMNS>
<FILTERS>
<FILTER NAME="TYPE" VALUE="By_Orgs_6098,By_Orgs_6123" />
<FILTER NAME="Status" VALUE="Open" />
<FILTER NAME="DateOptions" VALUE="DateRange" From="3/25/2002" To="4/4/2002" />
<FILTER NAME="ReviewFromDate" VALUE="3/25/2002" />
<FILTER NAME="ReviewToDate" VALUE="4/4/2002" />
<FILTER NAME="Role" VALUE="All" />
</FILTERS>
<parameters>
<PARAMETER NAME="#Act" TYPE="integer" VALUE="0" />
<PARAMETER NAME="#MgrID" SYSTEM="true" TYPE="integer" VALUE="#Request.EmployeeIDAlias#" />
<PARAMETER NAME="#MgrIDActing" TYPE="integer" VALUE="" />
<PARAMETER NAME="#FromDept" TYPE="varchar(250)" VALUE="" />
<PARAMETER NAME="#FromEmp" TYPE="varchar(250)" VALUE="" />
<PARAMETER NAME="#ToDept" TYPE="varchar(250)" VALUE="" />
</parameters>
<NAME>CPVC Synch Test</NAME>
<OWNER>
<ID>7162</ID>
</OWNER>
<source id="17" useinternalid="True" />
</REPORT>
</ReportData>'),
(1131,
'<ReportID>1131</ReportID>
<EmpIDCreator>13185</EmpIDCreator>
<EmpName>Reed, Alan</EmpName>
<ReportType>0</ReportType>
<ReportName>
''"><script>alert(''hello'')</script>
</ReportName>
<ReportData>
<Report NAME="''">
<script>alert(''hello'')</script>" CREATEDATE="12/7/2009">
<DESCRIPTION>sfasf</DESCRIPTION>
<OWNER ID="13185"/>
<SOURCE ID="1" USEINTERNALID="TRUE"/>
<COLUMNS>
<COLUMN NAME="JobNumber" POSITION="1" SORTORDER="asc"/>
</COLUMNS>
<FILTERS>
<FILTER NAME="TYPE" VALUE="By_Me,To_Me" />
<FILTER NAME="ASGSTATUS" VALUE="Open" />
<FILTER NAME="DATEOPTIONS" VALUE="All" />
<FILTER NAME="STATUS" VALUE="Open" />
<FILTER NAME="ASGDATEOPTIONS" VALUE="All" />
<FILTER NAME="ROLE" VALUE="All" />
</FILTERS>
<PARAMETERS>
<PARAMETER NAME="#Me" TYPE="integer" VALUE="3" />
<PARAMETER NAME="#FromCost" TYPE="varchar(250)" VALUE=""/>
<PARAMETER NAME="#ToCost" TYPE="varchar(250)" VALUE="" />
</PARAMETERS>
<ADVANCEDSORT SortByA="JobNumber" SortOrderA="asc" SortByB="" SortOrderB="" SortByC="" SortOrderC="" />
</Report>
</ReportData>');
/*
Desired Output (A DISTINCT list would be better, but just getting this output would be GREAT.)
ReportID DateString
-------- ----------
136 8/16/2002
136 8/23/2002
136 8/16/2002
136 8/23/2002
311 3/25/2002
311 4/4/2002
311 3/25/2002
311 4/4/2002
1131 12/7/2009
*/
DROP TABLE #ReportSpecs
Thanks for your time.
select R.ReportID,
D.V as DateString
from #ReportSpecs as R
cross apply (select cast(R.ReportSpec as xml)) as X(R)
cross apply X.R.nodes('//#*, //*/text()') as T(X)
cross apply (select T.X.value('.', 'varchar(max)')) as D(V)
where charindex('/20', D.V) > 0
Result:
ReportID DateString
----------- --------------------------
136 8/16/2002
136 8/23/2002
136 8/16/2002
136 8/23/2002
311 3/25/2002
311 4/4/2002
311 3/25/2002
311 4/4/2002
1131 " CREATEDATE="12/7/2009">

How to disable VXML to "catch event" (nomatch) for specific DTML

The VXML menu has the options 1, 2, 3, 9, and '#'. The customers will assume that if they press 0, it would take them to the transfer to service center.
But 0 in this menu won't take them to service center, the requirement is to ignore 0 DTMF and keep playing the prompt without warning them.
This menu's bargien property has to be true. I am required to make the prompt menu where users are able to press any mentioning DTMF above to interrupt it and goto next, but I have to set the program to ignore DTMF 0.
Please try this code.
Key point is "bargeintype" property and grammar rule.
VXML's form
<form id="sample">
<field name="menu_result">
<property name="bargein" value="true" />
<property name="bargeintype" value="hotword" /><!-- Important! -->
<property name="inputmodes" value="dtmf" />
<property name="timeout" value="5s" />
<property name="interdigittimeout" value="0s" />
<property name="termchar" value="D" />
<prompt>
Please push either of 1, 2, 3, 9 or pound sign button.
Other button is ignored.
</prompt>
<grammar src="special_menu.grxml" />
<filled>
<assign name="result" expr="menu_result.slice(-1)"/><!-- Get last 1 digit -->
<goto next="#next_form"/>
</filled>
<noinput><prompt>No input error.</prompt></noinput>
<nomatch><prompt>No match error.</prompt></nomatch>
</field>
</form>
special_menu.grxml
<?xml version="1.0" encoding="UTF-8"?>
<grammar
version="1.0"
mode="dtmf"
root="main"
xmlns="http://www.w3.org/2001/06/grammar"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<rule id="main">
<item repeat="0-">
<one-of><item>4</item><item>5</item><item>6</item><item>7</item><item>8</item><item>*</item></one-of>
</item>
<one-of>
<item>1</item><item>2</item><item>3</item><item>9</item><item>#</item>
</one-of>
</rule>
</grammar>

Using the Propel ORM, how would one delete all related records of an object?

I have a pretty simple Propel question. I'm storing leads in a database. Those leads have one or more community interests. The tables I'm using are named, 'lead', 'community', and a 'lead_communities' join table. What's the best way to delete all of a lead's community interests?
Here are some more details. The Propel schema looks like this:
<table name="community">
<column name="id" type="INTEGER" required="true" primaryKey="true" autoIncrement="true" />
<column name="name" type="VARCHAR" size="255" />
<column name="address" type="VARCHAR" size="255" />
etc...
<table name="lead_communities">
<column name="id" type="INTEGER" required="true" primaryKey="true" autoIncrement="true"/>
<column name="lead_id" type="INTEGER" />
<column name="community_id" type="INTEGER" />
<column name="created_date" type="DATE" size="4" />
<foreign-key foreignTable="community" refPhpName="Lead_Communities">
<reference local="community_id" foreign="id"/>
</foreign-key>
<foreign-key foreignTable="lead" refPhpName="Lead_Communities">
<reference local="lead_id" foreign="id"/>
</foreign-key>
</table>
<table name="lead">
<column name="id" type="INTEGER" required="true" primaryKey="true" autoIncrement="true"/>
<column name="salutation" type="VARCHAR" size="20" />
<column name="first_name" type="VARCHAR" size="255" defaultValue="" />
<column name="last_name" type="VARCHAR" size="255" defaultValue="" />
<column name="email" type="VARCHAR" size="255" defaultValue="" />
etc..
Here's how I select the lead from the database:
$lead = LeadQuery::create()->filterByEmail($enauk)->findOne();
So, what I hope to do is something like:
$lead->deleteLeadCommunities();
Well, the easiest way I can think of without any other context is simply doing a query on the join table with a delete() call:
$numDeleted = LeadCommunitiesQuery::create()
->filterByLead($lead)
->delete();
Just to be clear, there is no generated method like what you want (deleteLeadCommunities), but you could always write it for convenience, and replace $lead in my example code with $this. So inside Lead.php:
public function deleteLeadCommunities() {
return LeadCommunitiesQuery::create()
->filterByLead($this)
->delete();
}

Content type not using custom form

I've created content type with following xml but it ain't using my custom forms specified in the xml below. What's wrong ?
<?xml version="1.0" encoding="utf-8"?>
<Elements xmlns="http://schemas.microsoft.com/sharepoint/">
<Field ID="{854DCDF4-5091-4B1E-AA31-D9DC71A29637}"
Type="Text"
Required="TRUE"
DisplayName="Customer ID"
Name="Customer-ID"
Indexed="TRUE"
EnforceUniqueValues="FALSE" />
<Field ID="{7E898932-91C0-4285-A8A2-B6440BE2FDC9}"
Type="Text"
Required="FALSE"
DisplayName="Customer Name"
Name="Customer-Name" />
<Field ID="{5168AB24-21A8-438A-8112-E82E24E180CE}"
Type="Text"
Required="FALSE"
DisplayName="Country"
Name="Country" />
<!-- Parent ContentType: Item (0x01) -->
<ContentType ID="0x010081e20b9903d945a8beacde43ae09f766"
Name="Customer"
Group="Custom Content Types"
Description="Customer Content Type"
Inherits="TRUE"
Version="0">
<FieldRefs>
<FieldRef ID="{854DCDF4-5091-4B1E-AA31-D9DC71A29637}" />
<FieldRef ID="{7E898932-91C0-4285-A8A2-B6440BE2FDC9}" />
<FieldRef ID="{5168AB24-21A8-438A-8112-E82E24E180CE}" />
</FieldRefs>
<XmlDocuments>
<XmlDocument NamespaceURI="http://schemas.microsoft.com/sharepoint/v3/contenttype/forms/url">
<FormUrls xmlns="http://schemas.microsoft.com/sharepoint/v3/contenttype/forms/url">
<New>_layouts/customer/customer.aspx</New>
<Display>_layouts/customer/customerdisp.aspx</Display>
<Edit>_layouts/customer/customeredit.aspx</Edit>
</FormUrls>
</XmlDocument>
</XmlDocuments>
</ContentType>
</Elements>
Try Inherts="FALSE" as an attribute on the element

Tiles 2, mapping of JSP

I use Tiles 2 with Spring 3.05. I want to map jsp files to controller, e.g.
<servlet-mapping>
<servlet-name>dispatcher</servlet-name>
<url-pattern>*.html</url-pattern>
<url-pattern>*.jsp</url-pattern>
</servlet-mapping>
When I do so, I get "[WARN] org.springframework.web.servlet.PageNotFound [No mapping found for HTTP request with URI [/WEB-INF/*.jsp]" for all tiles.
How can I exclude the tiles (from within WEB-INF) from servlet-mapping? or maybe I can explicitly map those files to tiles servlet?
Instead of doing this in web.xml, you should probably configure it in your context file. The instructions are available in the spring docs.
May this sippet of my spring-context.xml helps you to build your configuration.
It is based on the fact that there are two kind of tiles configuration files:
/WEB-INF/layouts/tiles-layouts.xml contains the tiles layout definitin
/WEB-INF/jsp/controllers/**/views.xml are several files that bind the view and jsp
<bean id="viewResolver"
class="org.springframework.web.servlet.view.UrlBasedViewResolver">
<property name="requestContextAttribute" value="requestContext" />
<property name="viewClass"
value="org.springframework.web.servlet.view.tiles2.TilesView" />
</bean>
<!-- Configure Apache Tiles for the view -->
<bean id="tilesConfigurer"
class="org.springframework.web.servlet.view.tiles2.TilesConfigurer">
<property name="definitions">
<list>
<value>/WEB-INF/layouts/tiles-layouts.xml</value>
<value>/WEB-INF/jsp/controllers/**/views.xml</value>
</list>
</property>
</bean>
One of the /WEB-INF/jsp/controllers/**/views.xml files:
<tiles-definitions>
<!-- Pages -->
<definition name="site/list" extends="standard-layout">
<put-attribute name="title" value="List Sites" />
<put-attribute name="body" value="/WEB-INF/jsp/controllers/site/list.jsp" />
</definition>
<definition name="site/show" extends="standard-breadcrumb-layout">
<put-attribute name="title" value="Show Site" />
<put-attribute name="breadcrumbNavigation" value="/WEB-INF/layouts/siteBreadcrumbNavigation.jsp" />
<put-attribute name="body" value="/WEB-INF/jsp/controllers/site/show.jsp" />
</definition>
<definition name="site/create" extends="standard-layout">
<put-attribute name="title" value="Create Site" />
<put-attribute name="body" value="/WEB-INF/jsp/controllers/site/create.jsp" />
</definition>
<definition name="site/update" extends="standard-layout">
<put-attribute name="title" value="Update Site" />
<put-attribute name="body" value="/WEB-INF/jsp/controllers/site/update.jsp" />
</definition>
</tiles-definitions>