I have a Kendo UI grid with a custom column as such:
It calls a js function to build the html to inject as a form to submit for a delete:
And when you click on the item, the confirm box never displays, it just submits the form.
columns.Template(@<
text
></
text
>)
.Width(50)
.ClientTemplate("#= getDeleteHTML(Id, DisplayLocation) #");
function getDeleteHTML(itemId, itemName) {
var deleteHtml = "<
form
action
=
'"+ '
@Url.Action("Delete", "ManageLocations")'+"/" + itemId +"'
method
=
'post'
>"
+ "<
input
type
=
'image'
onclick
=
'return confirm(\"Are you sure you wish to delete: \r\n " + itemName + "?\");'
value
=
'Delete'
class
=
'delete'
src
=
'../Images/transparent.gif'
>"
+ "</
form
>";
return deleteHtml;
}
I want to break the confirmation message into 2 lines. I've tried \r\n and @Environment.NewLine + itemName as I'm not sure which parser is being used (client or server) in this case.
How can I achieve this? Sorry, I am fairly new to client side scripting so I'm sure this is easy, but supposedly just \r\n should work, but it doesn't...here is what is rendered in the browser:
<
form
action
=
"/CompanyMgmt/ManageLocations/Delete/1003"
method
=
"post"
><
input
type
=
"image"
onclick="return confirm("Are you sure you wish to delete:
RECV-A-01-1-1-1?");"
value
=
"Delete"
class
=
"delete"
src
=
"../Images/transparent.gif"
></
form
>