• Status: Solved
  • Priority: High
  • Security: Public
  • Views: 81
  • Last Modified:

Need help using Kendo UI grid in my MVC.Net application

Hi Experts,
I am using a Kendo UI grid in my MVC.Net application.
I have added an onclick event to one of my grid's columns.  The event takes 1 parameter (the value of the BatchID columns).
I also want to pass the value of the FileName column a second parameter.  Is this possible to do using the template of a given column?
If so, how?

You can see my code, and an image of my code below:
    function loadLog() {
        var BatchID = $("#hdnBatchID").val();
        $("#ELog").empty();
        $("#ELog").kendoGrid({
            dataSource: {
                type: "ajax",
                transport: {
                    read: function (options) {
                        $.ajax({
                            type: "POST",
                            url: '@Url.Action("GetLog", "EDI")',
                            dataType: "json",
                            data: JSON.stringify({ "BatchID": BatchID}),
                            contentType: 'application/json; charset=utf-8',
                            success: function (result) {
                                var data = result.FileDtls;
                                if (data != null)
                                    options.success(result)
                            }
                        })
                    }
                },
                schema: {
                    data: function (response) {
                        return response.FileDtls;
                    }
                },
                aggregate: [
                                { field: "Filename", aggregate: "count" },
                ]
            },
            height: 550,
            sortable: true,
            resizable: true,
            footer: true,
            selectable: "row",
            editable: false,
            filterable: true,
            toolbar: [{ name: "excel", text: "Export to Excel" }],
            excel: { fileName: "FileDtls.xlsx", allPages: true, filterable: true },
            change: onChange,
            columns: [
                        {
                            field: "Filename",
                            title: "Filename",
                            footerTemplate: "<div style='text-align:left;color:black;'>Total Records:  #= kendo.toString(count, 'n0') #</div>",
                        },
                        {
                            field: "BatchID",
                            title: "Batch ID",
                            template: "&nbsp;<input type='button' value='#=kendo.toString(BatchID)#' class='RoundCorner' onclick='getFile(#=kendo.toString(BatchID)#)' style='width: 90px;border:0; background-color:white; 			                            color:darkblue;' />",
                        },
                        {
                            field: "ClaimCnt",
                            title: "Claim Cnt",
                        },
                        {
                            field: "PostedCnt",
                            title: "Posted Cnt"
                        }

            ]
        });
    }

Open in new window


Image of code (hopefully it helps illustrate what I am trying to accomplish)
Image of code to help illustrate what i want to do
Thank you very much in advance,
mrotor
0
mainrotor
Asked:
mainrotor
  • 2
1 Solution
 
MishaProgrammerCommented:
When the event comes, work you method  "getFile(#=kendo.toString(BatchID)#)" with one parameter. Can you add the second parameter to this method?
0
 
MishaProgrammerCommented:
There is no activity from author
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now