I have a Barcode that is within a partial view. If I do not include a width and height at the beginning I get an error when rendering.
@Html.Kendo().Barcode().Name("barcode-" + Guid.NewGuid().ToString()).Value(@Model.WidgetTagValue).Encoding(Model.barcode_symbology).Width(150).Height(150)
I have a resize event that tries to change it to fit the size of the parent div on page init and on window resize.
function setBarcodeSize() {
if ($('.k-barcode').length > 0) {
$('.k-barcode').each(function () {
var parentDivWidth = $(this).closest(".andon-widget-container").width() - 50;
var parentDivHeight = $(this).closest(".andon-widget-container").height() - $(this).closest(".andon-widget-container").find(".andon-widget-title").height();
$(this).css("width", $(this).width(parentDivWidth) + "px").css("height", $(this).height(parentDivHeight) + "px");
$(this).data("kendoBarcode").redraw();
});
}
}
The width and height of the k-barcode <div> are set appropriately but the size of the child <div> with the data-role="surface" remains at 150x150
Advice?
Does Telerik have the ability to generate a IMB(OneCode) bar code?
I ask since I saw an option for the POSTNET barcode which was retired from the USPS in 2013.
Please advise.
Hi
Please sir, i have add barcode in my view and it works as code:
@(Html.Kendo().Barcode()
.Name("manchego")
.Value("2346722")
.Encoding(BarcodeSymbology.EAN8)
.Width(200)
.Height(100)
)
now i need to pass value to barcode from EmployeeViewModel for each employee to let me view them in my page as example :
<
ul
id
=
"dairy"
>
<
li
>
@* here pass value for employee 1 *@
@(Html.Kendo().Barcode().Name("manchego").Value("2346722").Encoding(BarcodeSymbology.EAN8).Width(200).Height(100))
</
li
>
<
li
>
@* here pass value for employee 2 *@
@(Html.Kendo().Barcode().Name("mascarpone").Value("Mascarpone").Encoding(BarcodeSymbology.Code128).Width(200).Height(100))
</
li
>
<
li
>
@* here pass value for employee 3 *@
@(Html.Kendo().Barcode().Name("gudbrands").Value("CHEESE").Encoding(BarcodeSymbology.Code39).Width(200).Height(100))
</
li
>
</
ul
>
and ect ..... for any other employee
so please how can i do that ?