Telerik Forums
Kendo UI for jQuery Forum
1 answer
102 views

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?

Mihaela
Telerik team
 answered on 15 Mar 2021
12 answers
2.4K+ views
Hi,

I am trying to prevent a checkbox column (first column) on a gird from reordering, I overrided the grid-column-reorder event and tried the e.PreventDefault after checking the correct index value(s) with no luck what so ever. I even tried calling grid.reorderColumn with no luck too. 

Is there anyway I can prevent a specific column from reordering but allow other columns to reorder ?

Tsvetomir
Telerik team
 answered on 15 Mar 2021
2 answers
645 views

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

Petar
Telerik team
 answered on 15 Mar 2021
15 answers
407 views
Hi,

I am evaluating Kendo UI and blocked by a problem that the column re-ordering feature doesn't work consistently when there're hidden columns. When I drag the column title to move a column forward or backward, only the column title is swapped but the column data stay at the original place and this make the column title and data doesn't match. I observe this problem both in Chrome and Firefox. I first observed this with my implementation that some columns are set as hidden in the first place. I then observed the same problems with your online demo (http://demos.telerik.com/kendo-ui/grid/persist-state) with Firefox. In the demo page, reordering works well unless you hide a column. The last column title sometimes disappears, too. Could you help to check out if this a known problem and whether it can be fixed soon? Thank you very much.

regards
Kenny
Mihaela
Telerik team
 answered on 12 Mar 2021
1 answer
904 views

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.

Nikolay
Telerik team
 answered on 12 Mar 2021
3 answers
132 views

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.

Georgi
Telerik team
 answered on 12 Mar 2021
1 answer
229 views

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

Mihaela
Telerik team
 answered on 11 Mar 2021
1 answer
133 views

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)?

Mihaela
Telerik team
 answered on 11 Mar 2021
3 answers
722 views
good morning everyone,

I am currently using the licensed version of Kendo UI Complete for ASP.NET MVC (Q2 2012) and trying to figure out if the Kendo UI Grid has something similar to the DataKeys method in the Telerik Extensions for ASP.NET MVC Grid?

Before this, I was using the licensed version of Telerik Extensions for ASP.NET MVC.  Below is the code I had for it.  You'll notice, there is a "DataKeys" method which I can associate the "Id" property of the Model, to each row of the Grid. 

@{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();
}


Is there something similar in the Kendo UI Grid???  Below is my current Kendo UI Grid.

@{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();
}

Thank you very much for your help.
Tsvetomir
Telerik team
 answered on 10 Mar 2021
3 answers
364 views

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

Georgi Denchev
Telerik team
 answered on 10 Mar 2021
Narrow your results
Selected tags
Tags
+? more
Top users last month
Will
Top achievements
Rank 2
Iron
Motti
Top achievements
Rank 1
Iron
Hester
Top achievements
Rank 1
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Thomas
Top achievements
Rank 2
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Will
Top achievements
Rank 2
Iron
Motti
Top achievements
Rank 1
Iron
Hester
Top achievements
Rank 1
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Thomas
Top achievements
Rank 2
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?