Hi,
I am trying to implement same way as ASP.NET Core PDF Export Key Features Demo | Telerik UI for ASP.NET Core
but Its exporting in client side but it's not going to controller. Don't know what mistake I am doing. Is there a way to send the pad to controller and send it to email attachment. Below is my code.
$("#btnSubmit").on("click", function (e) {
e.stopPropagation();
e.preventDefault();
var sigval = signature.value();
$('#lblSearchError').text('');
if (sigval === undefined || sigval === '') {
$('#lblSearchError').text('*Signature field is required.');
} else {
var data = $("#submitForm").serializeArray();
var obj = { name: 'signature', value: sigval };
data.push(obj);
// Convert the DOM element to a drawing using kendo.drawing.drawDOM
kendo.drawing.drawDOM($("#mainContect"))
.then(function (group) {
// Render the result as a PDF file
return kendo.drawing.exportPDF(group, {
paperSize: "auto",
margin: { left: "1cm", top: "1cm", right: "1cm", bottom: "1cm" }
});
})
.done(function (data) {
// Save the PDF file
kendo.saveAs({
type: 'POST',
dataURI: data,
fileName: "Provider.pdf",
proxyURL: '@Url.Action("Submit", "Provider")'
});
});
}
});
I tried proxyURL AND URL none of them worked. When I clicked on submit button it's just downloading the pdf file. But it not hitting controller.
and in controller
[HttpPost]
public ActionResult Submit(string contentType, string base64, string fileName)
{
//if (!ModelState.IsValid)
//{
// data.Id = 0;
// return Json(data, JsonRequestBehavior.AllowGet);
//}
//var providerData = portalServices.saveProviderData(data);
// return Json(providerData, JsonRequestBehavior.AllowGet);
var fileContents = Convert.FromBase64String(base64);
return File(fileContents, contentType, fileName);
}
I'm trying to use a menu helper in the drawer's Template and it's not working. Is this even possible? Do you have any examples of using other controls with the helper? All the examples are pretty simple.
Hi there,
I am using Kendo UI for ASP.NET MVC.
I am interested in using the Drawer as a side menu, but I can't seem to find a way to have it expanded by default when the page loads. Is this possible?
I tried to use fa icons in the drawer but it did not seem to resize / pad (in mini mode) properly. So some of the text was visible.
What am I missing?
Regards
Erwin
Hi,
how can I toggle the drawer mini mode / expanded mode from within the drawer itself.
The samle code I found has the toggle button in some other control, for example the toolbar.
I would like to have the drawer in mini mode and one item in the drawer to expand / collapse it.
When I expand the drawer from a handler function for itemClick, it expands but collapses at the end of the handler.
Regards
Erwin