Generate all possible permutations of a sentence - google-sheets

I have a Google Sheet and I want to generate all the possible permutations of a keyword (KW).
Eg:
I have a SpreadSheet
Outcome:
I.*have.*a|I.*a.*have|have.*I.*a|have.*a.*I|a.*have.*I|a.*I.*have
Issue, if the keyword is more then 4 words, i'm unable to generate the 4th+ word in the KW as seen above (Missing "SpreadSheet").
Currenlty this is the formula that is able to work upto 3 words.
=IFS(B5=1,B4,B5=2,query(SPLIT(B4, " "), "SELECT Col1")&".*"&query(SPLIT(B4, " "), "SELECT Col2")&"|"&query(SPLIT(B4, " "), "SELECT Col2")&".*"&query(SPLIT(B4, " "), "SELECT Col1"), B5>=3, query(SPLIT(B4, " "), "SELECT Col1")&".*"&query(SPLIT(B4, " "), "SELECT Col2")&".*"&query(SPLIT(B4, " "), "SELECT Col3")&"|"&query(SPLIT(B4, " "), "SELECT Col1")&".*"&query(SPLIT(B4, " "), "SELECT Col3")&".*"&query(SPLIT(B4, " "), "SELECT Col2")&"|"&query(SPLIT(B4, " "), "SELECT Col2")&".*"&query(SPLIT(B4, " "), "SELECT Col1")&".*"&query(SPLIT(B4, " "), "SELECT Col3")&"|"&query(SPLIT(B4, " "), "SELECT Col2")&".*"&query(SPLIT(B4, " "), "SELECT Col3")&".*"&query(SPLIT(B4, " "), "SELECT Col1")&"|"&query(SPLIT(B4, " "), "SELECT Col3")&".*"&query(SPLIT(B4, " "), "SELECT Col2")&".*"&query(SPLIT(B4, " "), "SELECT Col1")&"|"&query(SPLIT(B4, " "), "SELECT Col3")&".*"&query(SPLIT(B4, " "), "SELECT Col1")&".*"&query(SPLIT(B4, " "), "SELECT Col2"))
Example in Google Sheet
I tried adding the 4th word but gotten an error
"Unable to parse query string for Function QUERY parameter 2: PARSE_ERROR: Encountered " <INTEGER_LITERAL> "4 "" at line 1, column 12. Was expecting one of: "where" ... "group" ... "pivot" ... "order" ... "skipping" ... "limit" ... "offset" ... "label" ... "format" ... "options" ... "," ... "" ... "+" ... "-" ... "/" ... "%" ... "" ... "/" ... "%" ... "+" ... "-" ..."
The 4th formula.
=IFS(B5=1,B4,B5=2,query(SPLIT(B4, " "), "SELECT Col1")&".*"&query(SPLIT(B4, " "), "SELECT Col2")&"|"&query(SPLIT(B4, " "), "SELECT Col2")&".*"&query(SPLIT(B4, " "), "SELECT Col1"), B5=3, query(SPLIT(B4, " "), "SELECT Col1")&".*"&query(SPLIT(B4, " "), "SELECT Col2")&".*"&query(SPLIT(B4, " "), "SELECT Col3")&"|"&query(SPLIT(B4, " "), "SELECT Col1")&".*"&query(SPLIT(B4, " "), "SELECT Col3")&".*"&query(SPLIT(B4, " "), "SELECT Col2")&"|"&query(SPLIT(B4, " "), "SELECT Col2")&".*"&query(SPLIT(B4, " "), "SELECT Col1")&".*"&query(SPLIT(B4, " "), "SELECT Col3")&"|"&query(SPLIT(B4, " "), "SELECT Col2")&".*"&query(SPLIT(B4, " "), "SELECT Col3")&".*"&query(SPLIT(B4, " "), "SELECT Col1")&"|"&query(SPLIT(B4, " "), "SELECT Col3")&".*"&query(SPLIT(B4, " "), "SELECT Col2")&".*"&query(SPLIT(B4, " "), "SELECT Col1")&"|"&query(SPLIT(B4, " "), "SELECT Col3")&".*"&query(SPLIT(B4, " "), "SELECT Col1")&".*"&query(SPLIT(B4, " "), "SELECT Col2"), B5>=4, query(SPLIT(B4, " "), "SELECT Col1")&".*"&query(SPLIT(B4, " "), "SELECT Col2")&".*"&query(SPLIT(B4, " "), "SELECT Col3")&".*"&query(SPLIT(B4, " "), "SELECT Col 4")&"|"&query(SPLIT(B4, " "), "SELECT Col1")&".*"&query(SPLIT(B4, " "), "SELECT Col 2")&".*"&query(SPLIT(B4, " "), "SELECT Col4")&".*"&query(SPLIT(B4, " "), "SELECT Col 3")&"|"&query(SPLIT(B4, " "), "SELECT Col1")&".*"&query(SPLIT(B4, " "), "SELECT Col 3")&".*"&query(SPLIT(B4, " "), "SELECT Col2")&".*"&query(SPLIT(B4, " "), "SELECT Col 4")&"|"&query(SPLIT(B4, " "), "SELECT Col1")&".*"&query(SPLIT(B4, " "), "SELECT Col 3")&".*"&query(SPLIT(B4, " "), "SELECT Col4")&".*"&query(SPLIT(B4, " "), "SELECT Col 2")&"|"&query(SPLIT(B4, " "), "SELECT Col1")&".*"&query(SPLIT(B4, " "), "SELECT Col 4")&".*"&query(SPLIT(B4, " "), "SELECT Col2")&".*"&query(SPLIT(B4, " "), "SELECT Col 3")&"|"&query(SPLIT(B4, " "), "SELECT Col1")&".*"&query(SPLIT(B4, " "), "SELECT Col 4")&".*"&query(SPLIT(B4, " "), "SELECT Col3")&".*"&query(SPLIT(B4, " "), "SELECT Col 2")&"|"&query(SPLIT(B4, " "), "SELECT Col2")&".*"&query(SPLIT(B4, " "), "SELECT Col 1")&".*"&query(SPLIT(B4, " "), "SELECT Col3")&".*"&query(SPLIT(B4, " "), "SELECT Col 4")&"|"&query(SPLIT(B4, " "), "SELECT Col2")&".*"&query(SPLIT(B4, " "), "SELECT Col 1")&".*"&query(SPLIT(B4, " "), "SELECT Col4")&".*"&query(SPLIT(B4, " "), "SELECT Col 3")&"|"&query(SPLIT(B4, " "), "SELECT Col2")&".*"&query(SPLIT(B4, " "), "SELECT Col 3")&".*"&query(SPLIT(B4, " "), "SELECT Col1")&".*"&query(SPLIT(B4, " "), "SELECT Col 4")&"|"&query(SPLIT(B4, " "), "SELECT Col2")&".*"&query(SPLIT(B4, " "), "SELECT Col 3")&".*"&query(SPLIT(B4, " "), "SELECT Col4")&".*"&query(SPLIT(B4, " "), "SELECT Col 1")&"|"&query(SPLIT(B4, " "), "SELECT Col2")&".*"&query(SPLIT(B4, " "), "SELECT Col 4")&".*"&query(SPLIT(B4, " "), "SELECT Col1")&".*"&query(SPLIT(B4, " "), "SELECT Col 3")&"|"&query(SPLIT(B4, " "), "SELECT Col2")&".*"&query(SPLIT(B4, " "), "SELECT Col 4")&".*"&query(SPLIT(B4, " "), "SELECT Col3")&".*"&query(SPLIT(B4, " "), "SELECT Col 1")&"|"&query(SPLIT(B4, " "), "SELECT Col3")&".*"&query(SPLIT(B4, " "), "SELECT Col 1")&".*"&query(SPLIT(B4, " "), "SELECT Col2")&".*"&query(SPLIT(B4, " "), "SELECT Col 4")&"|"&query(SPLIT(B4, " "), "SELECT Col3")&".*"&query(SPLIT(B4, " "), "SELECT Col 1")&".*"&query(SPLIT(B4, " "), "SELECT Col4")&".*"&query(SPLIT(B4, " "), "SELECT Col 2")&"|"&query(SPLIT(B4, " "), "SELECT Col3")&".*"&query(SPLIT(B4, " "), "SELECT Col 2")&".*"&query(SPLIT(B4, " "), "SELECT Col1")&".*"&query(SPLIT(B4, " "), "SELECT Col 4")&"|"&query(SPLIT(B4, " "), "SELECT Col3")&".*"&query(SPLIT(B4, " "), "SELECT Col 2")&".*"&query(SPLIT(B4, " "), "SELECT Col4")&".*"&query(SPLIT(B4, " "), "SELECT Col 1")&"|"&query(SPLIT(B4, " "), "SELECT Col3")&".*"&query(SPLIT(B4, " "), "SELECT Col 4")&".*"&query(SPLIT(B4, " "), "SELECT Col1")&".*"&query(SPLIT(B4, " "), "SELECT Col 2")&"|"&query(SPLIT(B4, " "), "SELECT Col3")&".*"&query(SPLIT(B4, " "), "SELECT Col 4")&".*"&query(SPLIT(B4, " "), "SELECT Col2")&".*"&query(SPLIT(B4, " "), "SELECT Col 1")&"|"&query(SPLIT(B4, " "), "SELECT Col4")&".*"&query(SPLIT(B4, " "), "SELECT Col 1")&".*"&query(SPLIT(B4, " "), "SELECT Col2")&".*"&query(SPLIT(B4, " "), "SELECT Col 3")&"|"&query(SPLIT(B4, " "), "SELECT Col4")&".*"&query(SPLIT(B4, " "), "SELECT Col 1")&".*"&query(SPLIT(B4, " "), "SELECT Col3")&".*"&query(SPLIT(B4, " "), "SELECT Col 2")&"|"&query(SPLIT(B4, " "), "SELECT Col4")&".*"&query(SPLIT(B4, " "), "SELECT Col 2")&".*"&query(SPLIT(B4, " "), "SELECT Col1")&".*"&query(SPLIT(B4, " "), "SELECT Col 3")&"|"&query(SPLIT(B4, " "), "SELECT Col4")&".*"&query(SPLIT(B4, " "), "SELECT Col 2")&".*"&query(SPLIT(B4, " "), "SELECT Col3")&".*"&query(SPLIT(B4, " "), "SELECT Col 1")&"|"&query(SPLIT(B4, " "), "SELECT Col4")&".*"&query(SPLIT(B4, " "), "SELECT Col 3")&".*"&query(SPLIT(B4, " "), "SELECT Col1")&".*"&query(SPLIT(B4, " "), "SELECT Col 2")&"|"&query(SPLIT(B4, " "), "SELECT Col4")&".*"&query(SPLIT(B4, " "), "SELECT Col 3")&".*"&query(SPLIT(B4, " "), "SELECT Col2")&".*"&query(SPLIT(B4, " "), "SELECT Col 1"))
Is there a way I can generate the 4th or more KW variant or maybe with something simpler that will input from 1 cell and output into 1 cell?
Thanks.

see: https://stackoverflow.com/a/74160711/5632629
try:
where A3:
=FLATTEN(SPLIT(A1, " "))
C3:
=LAMBDA(z, LAMBDA(x, y, INDEX(QUERY(FLATTEN(IF((x<y)+(x>y), x&".*"&y, )),
"where Col1 is not null", )))(z, TRANSPOSE(z)))(A3:INDEX(A3:A6, COUNTA(A3:A6)))
D3:
=LAMBDA(x, y, INDEX(QUERY(FLATTEN(IF(REGEXMATCH(x, y),, x&".*"&y)),
"where Col1 is not null", )))(C3:INDEX(C3:C, COUNTA(C3:C)),
TRANSPOSE($A3:INDEX($A3:$A14, COUNTA($A3:$A14))))
E3:
=LAMBDA(x, y, INDEX(QUERY(FLATTEN(IF(REGEXMATCH(x, y),, x&".*"&y)),
"where Col1 is not null", )))(D3:INDEX(D3:D, COUNTA(D3:D)),
TRANSPOSE($A3:INDEX($A3:$A14, COUNTA($A3:$A14))))
G3:
=TEXTJOIN("|", 1, E3:E)

Related

Unable to parse query string for Function QUERY parameter

Trying to run this query:
=query(IMPORTRANGE("XXXXXXX","'XX'!A:H"), "where Col3 = '666' and select Col1, Col2, Col3, Col4, Col5, Col6, Col7, Col8 and order by Col5 desc",1)
And keep on getting weird errors such as this one
Unable to parse query string for Function QUERY parameter 2: PARSE_ERROR: Encountered " "select" "select "" at line 1, column 24. Was expecting one of: "true" ... "false" ... "not" ... "date" ... "timeofday" ... "datetime" ... "timestamp" ... "min" ... "max" ... "avg" ... "count" ... "sum" ... "no_values" ... "no_format" ... "is" ... "null" ... "year" ... "month" ... "day" ... "hour" ... "minute" ... "second" ... "millisecond" ... "with" ... "contains" ... "starts" ... "ends" ... "matches" ... "like" ... "now" ... "dateDiff" ... "quarter" ... "lower" ... "upper" ... "dayOfWeek" ... "toDate" ... ... <INTEGER_LITERAL> ... <DECIMAL_LITERAL> ... <STRING_LITERAL> ... <QUOTED_ID> ... "(" ... "-" ...
Not sure why the error is referring to column 24 where I clearly didn't ask for it :)
Any thoughts?
should be:
=QUERY(IMPORTRANGE("XXXXXXX", "'XX'!A:H"),
"select Col1,Col2,Col3,Col4,Col5,Col6,Col7,Col8
where Col3 = '666'
order by Col5 desc", 1)

(sql plus) how to alias column

I've been trying to use aliases to change column names
I have three tables : name , member and payment
I took two different syntax from the internet and I tried them both
first one:
SELECT n.firstname AS [First Name], n.lastname AS [Last Name], m.username AS UserName,
m.birthday AS Birthday, m.email AS Email, m.phone_no AS Phone,
p.MembershipType AS [Membership Type]
FROM member AS m, name AS n, payment AS p
WHERE (m.username = n.username) and (m.username = p.username)
ORDER by n.firstname;
second one:
SELECT n.firstname 'First Name', n.lastname 'Last Name', m.username
'UserName', m.birthday 'Birthday',
m.email 'Email', m.phone_no 'Phone', p.MembershipType 'Membership Type'
FROM member m, name n, payment p
WHERE (m.username = n.username) and (m.username = p.username)
ORDER by n.firstname;
But it display "FROM keyword not found where expected"
what did I do wrong?
I am assuming that you are using Oracle database.
If the alias_name contains spaces, you must enclose the alias_name in quotes
So your query might look like:
SELECT n.firstname "First Name", n.lastname "Last Name", m.username
"UserName", m.birthday "Birthday",
m.email "Email", m.phone_no "Phone", p.MembershipType "Membership Type"
FROM member m, name n, payment p
WHERE (m.username = n.username) and (m.username = p.username)
ORDER by n.firstname;

Skip first occurrence of semicolon using regex

I am trying to skip the first semicolon in the string and do a split on the rest of the semicolon using a regular expression:
lines = </li> <li> Urinary tract infection </li> <li> Respiratory infection </li> <li> Sinus problems; and </li> <li> Ear infections; <li> Some more info </li>
I am using this code to split this at every semicolon except the first one:
lines.split(/(?<!\\\\);/)
My expected output is:
["</li> <li> Urinary tract infection </li> <li> Respiratory infection </li> <li> Sinus problems; and </li> <li> Ear infections","<li> Some more info </li>" ]
Note that the string could be long with any number of semicolons but I want to prevent the splitting from happening only from the first semicolon.
Must I use a regex?
str = "Now is; the time; for all good; people; to party"
f, sc, l = str.partition(';')
af, *a = str[str.index(';')+1..-1].split(';')
[f+sc+af, *a]
#=> ["Now is; the time", " for all good", " people", " to party"]
The steps:
f, sc, l = str.partition(';')
#=> ["Now is", ";", " the time; for all good; people; to party"]
f #=> "Now is"
sc #=> ";"
l #=> " the time; for all good; people; to party"
idx = str.index(';')+1
#=> 7
b = str[idx..-1]
#=> " the time; for all good; people; to party"
af, *a = b.split(';')
af #=> " the time"
a #=> [" for all good", " people", " to party"]
[f+sc+af, *a]
#=> ["Now is; the time", " for all good", " people", " to party"]
For the OP's example:
f, sc, l = lines.partition(';')
af, *a = lines[lines.index(';')+1..-1].split(';')
[f+sc+af, *a]
#=> ["</li> <li> Urinary tract infection </li> <li> Respiratory infection\
</li> <li> Sinus problems; and </li> <li> Ear infections",
# " <li> Some more info </li>"]
Another way:
b = str.sub(';', 0.chr).split(';')
#=> ["Now is\u0000 the time", " for all good", " people", " to party"]
a[0].sub!(0.chr, ';')
#=> "Now is; the time"
a #=> ["Now is; the time", " for all good", " people", " to party"]

How to append further fields to select list item "Text" in MVC 3?

I have:
ViewBag.StdLibraryId = new SelectList(db.StdLibrary, "Id", "Name",stdlibraryitem.StdLibraryId);
I want to append another column's value to the text output, so it would be something like
ViewBag.StdLibraryId = new SelectList(db.StdLibrary, "Id", Model.Name + "(" + model.Category.Name + ")", stdlibraryitem.StdLibraryId);
However, obviously the code above is wrong. Also I am tending to use Lambda expressions in my LINQ.
What should the code look like?
Huge thanks in advance.
EDIT
My new code:
ViewBag.StdLibraryId = new SelectList(db.StdLibrary.Select(r=> new {Id = r.Id, Name= r.Name + "(" + r.StdSection.Name + ")"}), "Id", "Name", stdlibraryitem.StdLibraryId);
You may just use an anonymous object in which you will make your concatenation.
var stdLibraryForCombo = db.StdLibrary
.Select(m => new {
Id = m.Id,
Name = m.Name + " (" + m.Category.Name + ")"
});
ViewBag.StdLibraryId = new SelectList(stdLibraryForCombo, "Id", "Name", stdlibraryitem.StdLibraryId);

Date Formatting not working - Telerik grid details

I am hoping this is easy. I googled and looked through the forums and cannot find a solid answer. One answer was to add the calendar js file but that did not seem to work.
Look at the highlighted code below. The first 2, with formatting defined, are blank and should not be. The next 2 have real long date formats when all I need is “MM/dd/yyyy”. Yikes!
<%= Html.Telerik().Grid<ViewModelProcurementAction>(Model.ProcurementActions) //
.Name("ProcurementActionGrid")
.DetailView(details => details.ClientTemplate(
Html.Telerik()
.TabStrip()
.Name("TabStrip_<#= Id #>")
.SelectedIndex(0)
.Items(items =>
{
items.Add().Text("Additional Info").Content(
"<table>" +
"<tr>" +
"<td style='vertical-align: top'>" +
"<b>Summary Description:</b><br/><#= SummaryDescription #>" +
"</td>" +
"<td style='vertical-align: top'>" +
//"<ul>" +
"<b>Modification Number:</b> <#= ModificationNumber #><br/>" +
"<b>Funding Type:</b> <#= FundingTypeName #><br/>" +
"<b>Department Name:</b> <#= DepartmentName #><br/>" +
"<b>Solicitation Type:</b> <#= SolicitationTypeName #><br/>" +
"<b>Date Entered:</b> <#= $.telerik.formatString('{0:d}', DateEntered) #><br/>" +
//"</ul>" +
"</td>" +
"<td style='vertical-align: top'>" +
"<b>FY12:</b> <#= $.telerik.formatString('{0:c0}', FyByKey[\"FY12\"]==null ? 0 : FyByKey[\"FY12\"]) #><br/>" +
"<b>FY13: </b><#= $.telerik.formatString('{0:c0}', FyByKey[\"FY13\"]==null ? 0 : FyByKey[\"FY13\"]) #><br/>" +
"<b>FY14: </b><#= $.telerik.formatString('{0:c0}', FyByKey[\"FY14\"]==null ? 0 : FyByKey[\"FY14\"]) #><br/>" +
"<b>FY15: </b><#= $.telerik.formatString('{0:c0}', FyByKey[\"FY15\"]==null ? 0 : FyByKey[\"FY15\"]) #><br/>" +
"<b>FY16: </b><#= $.telerik.formatString('{0:c0}', FyByKey[\"FY16\"]==null ? 0 : FyByKey[\"FY16\"]) #><br/>" +
"<b>FY17: </b><#= $.telerik.formatString('{0:c0}', FyByKey[\"FY17\"]==null ? 0 : FyByKey[\"FY17\"]) #><br/>" +
"<b>Out Year Funding: </b><#= $.telerik.formatString('{0:c0}', OutYearFunding==null ? 0 : OutYearFunding ) #><br/>" +
"</td>" +
"<td style='vertical-align: top'>" +
"<b>DBE %: </b><#= $.telerik.formatString('{0:0}', DBE==null ? 0 : DBE) #><br/>" +
"<b>Amount Exceeds: </b><#= AmountExceeds #><br/>" +
//--------------------------------------------------------------------------------
"<b>Cost/Price Analysis Date: </b><#= $.telerik.formatString('{0:MM/dd/yyyy}', CostPriceAnalysisDate==null ? '' : CostPriceAnalysisDate) #><br/>" +
"<b>OIG Review Completion Date: </b><#= $.telerik.formatString('{0:shortDate}', OIGReviewCompletionDate==null ? '' : OIGReviewCompletionDate) #><br/>" +
"<b>Required Procurement Initiation Date: </b><#= RequiredProcurementInitiationDate #><br/>" +
"<b>Required Date of Award: </b><#= RequiredDateOfAward #><br/>" +
//--------------------------------------------------------------------------------
"<b>Number of Option Years: </b><#= NumberOfOptionYears #><br/>" +
"<b>Budget Approval: </b><#= BudgetApproval #><br/>" +
"<b>Point of Contact: </b><#= PointOfContact #><br/>" +
"</td>" +
"<td style='vertical-align: top'>" +
"<b>PRMT Group: </b><#= PRMTGroupName #><br/>" +
"<b>Planned CA Responsible: </b><#= PlannedCAResponsibleFullName #><br/>" +
"<b>Value of Option Years: </b><#= $.telerik.formatString('{0:0}', ValueOfOptionYears==null ? 0 : ValueOfOptionYears) #><br/>" +
"<b>Award Amount: </b><#= $.telerik.formatString('{0:0}', AwardAmount==null ? 0 : AwardAmount) #><br/>" +
"<b>Awarded Vendor: </b><#= AwardedVendor #><br/>" +
"<b>Multiple Year Funding: </b><#= MultipleYearFunding #><br/>" +
"<b>Period of Performance: </b><#= $.telerik.formatString('{0}{1}{2}', PeriodOfPerformanceStartDate==null ? '' : PeriodOfPerformanceStartDate, PeriodOfPerformanceEndDate==null ? '' : ' - ', PeriodOfPerformanceEndDate==null ? '' : PeriodOfPerformanceEndDate) #><br/>" +
"<b>Comments: </b><#= Comments #><br/>" +
"</td>" +
"</tr>" +
"</table>"
);
items.Add().Text("Purchase of Materials").Content(
"<br/><input type='checkbox' disabled='disabled' name='AwaitingProcurementPackEnabled' <#= AwaitingProcurementPackEnabled ? checked='checked' : '' #> /> <b>Awaiting Procurement pack from Point of Contact</b><br/>" +
Html.Telerik()
.Grid<ViewModelProcurementActivity>()
.Name("ActionGrid_<#= Id #>")
.Footer(false)
.Columns(c =>
{
c.Command(commands =>
{
commands.Edit().ButtonType(GridButtonType.ImageAndText);
}).Title("Actions").Width(120);
c.Bound(e => e.ActivityId).Visible(false);
c.Bound(e => e.Activity);
c.Bound(e => e.OriginalPlannedDate);
c.Bound(e => e.CurrentPlannedDate);
c.Bound(e => e.ActualDate);
c.Bound(e => e.ReasonForDateChange);
})
.DataBinding(dataBinding =>
dataBinding.Ajax()
.Select("AjaxGetActionDatesFor", "ProcurementActions", new { procurementActionId = "<#= Id #>" })
.Update("AjaxUpdateActionDatesFor", "ProcurementActions")
.Enabled(true)
)
.DataKeys(keys => keys.Add(c => c.ActivityId))
.Editable(editing => editing.Mode(GridEditMode.InLine)
)
.Selectable()
.ToHtmlString()
);
})
.ToHtmlString()
))
.Columns(c =>
{
c.Command(commands =>
{
commands.Edit().ButtonType(GridButtonType.ImageAndText);
commands.Delete().ButtonType(GridButtonType.ImageAndText);
commands.Custom("showHistory")
.ButtonType(GridButtonType.ImageAndText)
.Text("History")
.Action("Show", "ProcurementActions")
.DataRouteValues(route => { route.Add(o => o.Id).RouteKey("id"); });
}).Title("Actions").Width(100);
c.Bound(e => e.Id).Visible(false);
c.Bound(e => e.ActionId).Visible(false);
c.Bound(e => e.ContractNumber).HtmlAttributes(new {style = "vertical-align: top"});
c.Bound(e => e.ContractManager).Width(120).HtmlAttributes(new {style = "vertical-align: top"});
c.Bound(e => e.ActualCAResponsible).Width(150).HtmlAttributes(new {style = "vertical-align: top"});
c.Bound(e => e.TitleOfRequirement).HtmlAttributes(new {style = "vertical-align: top"});
c.Bound(e => e.CipOrName).Title("Project Id").HtmlAttributes(new {style = "vertical-align: top"});
c.Bound(e => e.RecordTypeName).Title("Record Type").HtmlAttributes(new {style = "vertical-align: top"});
c.Bound(e => e.FullContractType).Title("Contract Type").HtmlAttributes(new { style = "vertical-align: top" });
c.Bound(e => e.ProcurementActionYearDisplayName).Title("Plan FY").HtmlAttributes(new { style = "vertical-align: top" });
})
.DataKeys(keys => keys.Add(o => o.Id))
.DataBinding(dataBinding =>
dataBinding.Ajax()
.OperationMode(GridOperationMode.Client)
.Select("AjaxGetAll", "ProcurementActions") //, new { procurementActionId = "<#= CurrentAction #>" })
.Update("AjaxUpdate", "ProcurementActions")
.Delete("AjaxDelete", "ProcurementActions")
.Enabled(true)
)
.Editable(editing =>
editing.Mode(GridEditMode.PopUp)
.TemplateName("EditProcurementAction")
//? .AdditionalViewData(new { ListAllProcurementActionDateTypes = Model.AllProcurementActionDateTypes })
//? .AdditionalViewData(Model.AllUsers)
//? .AdditionalViewData(Model.ContractTypes)
//? .AdditionalViewData(Model.FundingTypes)
)
.Pageable(paging => paging.PageSize(15))
.Scrollable(scrolling => scrolling.Height(500))
.Filterable()
.Sortable()
%>
At the end of my file I changed this:
<%= Html.Telerik().ScriptRegistrar() %>
To this:
<%= Html.Telerik()
.ScriptRegistrar()
.DefaultGroup(group => group.Add("telerik.common.js")
.Add("telerik.calendar.js")
.Add("telerik.datepicker.js")
.Add("telerik.textbox.js"))
%>
Still nothing.
I am trying to deliver this today (for the final time) and am getting dinged for formatting.
Any thoughts?
-kb
So I finally tracked down how to do this correctly in the ClientTemplate:
"<b>Cost/Price Analysis Date: </b><#= $.telerik.formatString('{0:MM/dd/yyyy}', CostPriceAnalysisDate==null ? \"\" : CostPriceAnalysisDate) #><br/>" +
"<b>OIG Review Completion Date: </b><#= $.telerik.formatString('{0:MM/dd/yyyy}', OIGReviewCompletionDate==null ? \"\" : OIGReviewCompletionDate) #><br/>" +
"<b>Required Procurement Initiation Date: </b><#= $.telerik.formatString('{0:MM/dd/yyyy}', RequiredProcurementInitiationDate==null ? \"\" : RequiredProcurementInitiationDate) #><br/>" +
"<b>Required Date of Award: </b><#= $.telerik.formatString('{0:MM/dd/yyyy}', RequiredDateOfAward==null ? \"\" : RequiredDateOfAward) #><br/>" +
You need to make a call into $.telerik.formatString(...)

Resources