Telerik Forums
Kendo UI for jQuery Forum
1 answer
234 views

Hello

i need to change custom command icon depend on row field for instance "Status" i tried this code but it doesn't work

@using EliteInsurer.Areas.Admin.Dto;
@using Kendo.Mvc.UI;
<div class="k-rtl">
    @(
        Html.Kendo().Grid<HostedTaskDto>()
        .Name("grid")
        .Columns(columns =>
        {
                columns.Bound(m => m.Status);
                columns.Command(p =>
                {
                p.Custom("StartTask").Text(" ").Click("changestatus").IconClass("#=getCommandIcon#");

            });

        })
        .ToolBar(tools =>
        {
            tools.Excel();
            tools.Create().Text(" ");
        })
        .Pageable(p => p.PageSizes(true).Input(true))
        .Sortable()
        .Filterable(fr => fr.Mode(GridFilterMode.Row))
        .Resizable(resize => resize.Columns(true))
        .Scrollable()
        .Excel(ex => ex.AllPages(true))
        .Editable(e => e.Mode(GridEditMode.InLine))
        .DataSource(dataSource => dataSource
        .Ajax()
        .GroupPaging(true)
        .PageSize(50)
        .Read("GetTasks", "Task")
        .Create("NewTask", "Task")
        .Update("EditTask", "Task")
        .Destroy("DeleteTask", "Task")
        .PageSize(20)
        .Model(model =>
        {
            model.Id(p => p.Id);
            model.Field(p => p.Status).Editable(false);
            
        })

        )
        )
</div>
<script>
    function forgeryToken() {
        return kendo.antiForgeryTokens();
    }
    
    function changestatus(e) {
        var dataItem = this.dataItem($(e.currentTarget).closest("tr"));

        $.ajax({
            type: "POST",
            url: '@Url.Action("ChangeTaskStatus", "Task")',
            datatype: "json",
            traditional: true,
            data: { Id: dataItem.Id },
            success: function (data) {
                if (data.success == true) {
                    var grid = $("#grid").data("kendoGrid");
                    grid.dataSource.read();
                    alert(data.message);
                }
            },
            error: function (data) {
                alert(data.message);
                console.log(error);
            }

        });
    }
    function getCommandIcon(e) {
        var dataItem = this.dataItem($(e.currentTarget).closest("tr"));
        var status = dataItem.Status;
        console.log(status);
        if (status === "1") {
            return "k-icon k-i-stop";
        } else {
            return "k-icon k-i-play";
        }
    }

</script>
Anton Mironov
Telerik team
 answered on 07 Dec 2023
1 answer
69 views

On  previous updates, selected filters are showing in blue colour.

But now even applying single or multiple filters still color not changed.

 

Neli
Telerik team
 answered on 07 Dec 2023
1 answer
143 views

Hi,

I need to send some dynamic parameters, (path and others), when uploading files from js.
I've tried several ways, without success. Can anyone help me?
Neli
Telerik team
 answered on 07 Dec 2023
1 answer
114 views

I cannot work out how to set the CHILD grid column widths and positions. I can set all the master grid column widths and positions.

When calling grid.getOptions(), I can only see a reference to the MASTER grid column properties.

I can set all the master grid column widths and positions with this function:

function setColumFormat(){

    var grid = $("#kdClaimStatus").data("kendoGrid");  
    var options = localStorage["grid-column-options"];  
    if (options) {  
        var parsedOptions = JSON.parse(options);  
        var columns = parsedOptions.columns;
        grid.setOptions({ columns: columns });  
    }  
}

But I cannot work out how to set the CHILD grid column widths and positions. I have searched Telerik documentation and cannot find any solution.

Neli
Telerik team
 answered on 07 Dec 2023
1 answer
101 views
Hi,

I'm trying to incorporate a full-screen function into the spreadsheet toolbar with the following configuration:

$("#spreadsheet").kendoSpreadsheet({
    sheets: sheets,
    toolbar: {
        home: [
        {
            type: "button",
            text: "Full Screen",
            showText: "overflow",
            icon: "k-icon k-i-full-screen",
            click: function () {
                if (document.fullscreenElement) {
                    document.exitFullscreen();
                } else {
                    $('#spreadsheet').get(0).requestFullscreen();
                }
            }
        }
        ]
    }
});

After clicking the full-screen button, the spreadsheet block goes full screen, but certain built-in popups don't show (e.g., validation list, warning popups, color picker, export popups...). I suspect this is because all the elements that aren't showing are outside my spreadsheet element. Is there a solution to this, or another way to make the spreadsheet block go full screen?

Thanks for your help!
Patrick | Technical Support Engineer, Senior
Telerik team
 answered on 06 Dec 2023
1 answer
66 views

Hello Teacher:

          My front-end code:

var dataSource = new kendo.data.DataSource({
                type: "aspnetmvc-ajax",
                pageSize: 25000,
                serverPaging: false,
                serverGrouping: false,
batch: true,
                transport: {
                    read: {
                        url: urlRead,
                        data: kendo.antiForgeryTokens(),
                        type:"GET"
                    },

                    create: {
                        url: urlCreate,
                        data: kendo.antiForgeryTokens(),
                        cache: true,

                    },
                    update: {
                        url: urlUpdate,
                        data: kendo.antiForgeryTokens(),
                        cache: true,
                    },
                    destroy: {
                        url: urlDestroy,
                        data: kendo.antiForgeryTokens(),
                        cache: true
                    },

                    parameterMap: function (data, type) {
                        //if (type == "create") {
                        //    // send the created data items as the "models" service parameter encoded in JSON
                        //    return { models: kendo.stringify(data.models) };
                        //}
                    }

                },
                //requestStart: function() {
                //    kendo.ui.progress($("#"+gridName), true);
                //},
                //requestEnd: function() {
                //    kendo.ui.progress($("#"+gridName), false);
                //},
                sync: function (e) {


                },
                schema: {
                    data: "Data",
                    total: "Total",
                    errors: "Errors",
                    model: model,
                    errors: function (response) {
                        //ShowNotification(response);
                        return response.error;
                    }
                },
                error: function (e) {
                    //ShowNotification("Error");
                    dataSource.cancelChanges();
                }
            });
            //dataSource.bind("error", function () { ShowNotification("dsError") });

            grid.setOptions({
                dataSource: dataSource,
                persistSelection: true,
                navigatable: true,
                resizable:true,
                reorderable:true,
                dataBound: function (e) {
                    if (e.sender.dataSource.view().length > 0) {
                        e.sender.select("tr:eq(0)");
                        grid.trigger("change");
                        grid.unbind("dataBound");
                    }

                }
            });

Processing data in batches, I don't know how the frontend sends backend requests and how the backend receives requests?

                                        
Neli
Telerik team
 answered on 06 Dec 2023
2 answers
88 views

Hi team,

I need to limit the number of entries in an editable grid.

Consider the following dojo:

https://dojo.telerik.com/eDeDEtAM

Number of rows is limited to 2. Works fine before 2023-R1-SP1 and fails since.

I tried to find a workaround without success. I tried beforeEdit event but it fails aborting creation of a new row...

It's a regression issue, please help!

Best regards,

Laurent.

 

Zornitsa
Telerik team
 answered on 06 Dec 2023
1 answer
69 views

I was asked a question a long time ago, but due to communication difficulties I never received the answer I requested.

I've created two example links to ask my question.



To find a unit price of 9,000 won or more in the program below:
Enter ">9000" in the Unit Price field.
This is a feature I developed.

https://www.speedmis.com/_mis/index.php?gubun=3032&isMenuIn=Y&isAddURL=Y

-->

https://www.speedmis.com/_mis/index.php?gubun=3032&isMenuIn=Y&allFilter=[{"operator":"contains","value":">9000","field":"dangga"}] &recently=N&isAddURL=Y





You cannot enter ">9000" if the field is defined as a number.

https://www.speedmis.com/_mis/index.php?gubun=1247&isMenuIn=Y

There was also an auto-completion function when writing numbers.
Special coding allows completion to begin automatically rather than in a number box between numbers.



Please edit the link below if you wish. thank you

https://dojo.telerik.com/OroMIBAK

Neli
Telerik team
 answered on 06 Dec 2023
1 answer
84 views
I reposted it with the same title.
Neli
Telerik team
 answered on 01 Dec 2023
1 answer
79 views
https://dojo.telerik.com/@AleksandarEvangelatov/OYeTIRod

During the close event, I observed a second Ajax call. Is this expected behavior?

 

after typing cha



after the close event

Neli
Telerik team
 answered on 30 Nov 2023
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?