If I have below code
$("#numeric").kendoNumericTextBox({
min: 0.25,
max: 20,
decimals: 2,
format: "#.00 years",
spinners: true,
restrictDecimals: true,
step: 0.25
});
Using the spinners, if the value changes to a whole number (eg: 1, 2, 3, etc...), it shows "1", "2", etc...
I just wanted to display like "1.00", "2.00" while the input is still in focus. Is this possible?
Hello,
I've got a grid that leverages the detailInit feature and the detail grid has a toolbar with a button in it.
I want each button in those detail grids to have the same link with a different id parameter. (eg: /my/link?id=1, /my/link?id=2, etc..)
Here are a few lines to give an idea of what I've got:
// ...
grid = $el.kendoGrid({
dataSource: ds,
detailTemplate: kendo.template($('#cc_ajax_contact_group_grid_detail_tpl').html()),
detailInit: function (e) {
// ...
// Calling method to init a detail grid.
},
// ...
// Init detail grid...
const detailGrid = $detailEl.kendoGrid({
dataSource: ds,
toolbar: kendo.template($('#cc_ajax_contact_group_grid_detail_toolbar_tpl').html()),
columns: [
// ...
],
autoBind: true,
noRecords: false,
sortable: false,
scrollable: false,
pageable: false
}).data('kendoGrid');
// ...
<!-- Grid Detail template -->
<script type="text/x-kendo-template" id="cc_ajax_contact_group_grid_detail_toolbar_tpl">
<div class="btn-group ml-2">
<a href="/ActionLink/GoesHere" class="btn btn-primary btn-sm cc_ajax_contact_group_member_add">
<i class="fa fa-plus" aria-hidden="true"></i>
Add Group Member
</a>
</div>
</script>
---
So, what I was hoping for was something in the template like this:
<a href="/ActionLink/GoesHere?GroupId=#=GroupId#"
But I'm seeing now after trying this that the dataSource model context for the grid rows won't be available in that toolbar template.
This makes sense I think.
So what I ended up doing is just adding a data attribute to the detail grid element.
This way I can use the toolbar buttons click event to select the parent grid and scoop up that data attribute.
Something like this:
// ...
const groupId = e.data.id;
const $detailRow = e.detailRow;
const $detailEl = $(app.foo.memberGridSelector, $detailRow);
$detailEl.data('contact-group-id', groupId);
// ...
And the button's click event:
// ...
const $btn = $(e.currentTarget);
const $gridEl = $btn.parents(app.foo.memberGridSelector).data('kendoGrid');
const groupId = $gridEl.data('contact-group-id');
// Now use that group id to make an $.ajax call with jquery.
// ...
---
So my question: Is there an easier way to do this or is above approach a reasonable solution?
Thanks,
Andy
Is there a way to remove or change the color of the border that is rendered on the right side of the plot area?
Similarly, is there a way to remove or change the color of the border that is rendered on the right side of a bar chart bar?
I can see the SVG elements that draw them but I can't find a way to change the color.
I've attached a picture with red arrows pointing at the elements I'm asking about.
I have dynamically created, unpredictable (but always valid) kendo object .
Inside this object, there will sometimes be a rowTemplate method.
This object is then passed through a functionA that makes a few changes to the object (assigning default values etc.) before being passed into (sometimes) multiple kendogrids.
However, a problem arises when the rowTemplate method needs to reference the kendo grid element that it exists inside:
The parameters for rowTemplate only include the dataItem, which has no reference to the grid element or any of it's children and as the kendo object is created outside of where it is passed in to the kendo grid elements I have no scope to the grid element nor any ID it may have.
I've tried looking at the arguments to check to see if there are any extra parameters that I'm missing and there are none.
I have checked the value of this and it seems to evaluate to window.
Event is also not something I think that I can make use of.
https://dojo.telerik.com/ATesALoM/2
Two workarounds that I have thought of:
I could potentially attach a field when editing the object in functionA that is equal to the value of the to-be-created grid's ID and the grids can make use of this column in order to reference the kendo element.
The other workaround would be to (from functionA) programmatically loop through the object in search of any function and to bind those functions to the grid element, then simply have those functions assume that "this" will always be equal to the kendo grid element.
Both of these workarounds have drawbacks and I would rather only use them as a last resort.
Is there is something I am missing that would greatly simplify this?
If you require any clarification or examples needed please let me know and I'll provide them.
Hi - we use MVVM binding al lot in our kendo application.
Are there any samples / help pages that list the attribute names to use when declaring a TileLayout in MVVM style ?
Something similar to the information presented on this page: https://demos.telerik.com/kendo-ui/mvvm/widgets
Regards
Tom
I have this code below
$("#numeric").kendoNumericTextBox({
min: 1,
max: 100,
decimals: 0,
format: "# pieces",
spinners: true,
restrictDecimals: true
});
My problem is that if user enter "0", then tab out, value changes to "1" only, not "1 pieces"
So it does not follow the format if the entered value is below the min. No problem if value is more than max.
My version is "2018.3.1017", upgrade is not an option.
Do you have a workaround on how to force to change the display value with format (may be on the onblur event perhaps)?
@{Html.Telerik().Grid(Model)
.Name("grdAllUsers")
.DataKeys(keys => keys.Add(k =>
k.Id)
)
.Columns(columns =>
{
columns.Bound(o => o.FirstName)
.Width(150);
columns.Bound(o => o.LastName)
.Width(150);
columns.Bound(o => o.EmailAddress)
.Width(200);
.Width(70)
.HtmlAttributes(new { style = "text-align:center" });
})
.NoRecordsTemplate(@<
text
>No User records to display.</
text
>)
.Pageable(paging =>
paging.PageSize(15)
)
.Sortable()
.Filterable()
.Render();
}
@{Html.Kendo().Grid(Model)
.Name("grdAllUsers")
.Columns(columns =>
{
columns.Bound(o => o.FirstName)
.Width(150);
columns.Bound(o => o.LastName)
.Width(150);
columns.Bound(o => o.EmailAddress)
.Width(200);
.Width(70)
.HtmlAttributes(new { style = "text-align:center" });
})
.Pageable(paging =>
paging.PageSize(15)
)
.Sortable()
.Filterable()
.Render();
}
Hello,
we have a TileLayout with a Pie Chart inside. The Pie Chart is diaplaying labels.
Unfortunately when the tile size is reduced, the labels are cut off (horizontally and vertically).
Is there any way to prevent this.
Example:
Reduce the width of the Pie Chart in this dojo: https://dojo.telerik.com/EsOWoqAL